Skip to content

Commit

Permalink
update babel part in transforms (#194)
Browse files Browse the repository at this point in the history
* update babel part in transforms

* fix typo

* improve sentences slightly

* remove redundant text
  • Loading branch information
DeMoorJasper authored and fathyb committed Jul 14, 2018
1 parent 5e61824 commit 5709c09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/i18n/en/docs/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ First we need to install the dependencies for Preact.
npm install --save preact
npm install --save preact-compat
npm install --save-dev parcel-bundler
npm install --save-dev babel-preset-env
npm install --save-dev babel-preset-preact
```

Expand All @@ -47,7 +46,6 @@ npm install --save-dev babel-preset-preact
yarn add preact
yarn add preact-compat
yarn add --dev parcel-bundler
yarn add --dev babel-preset-env
yarn add --dev babel-preset-preact
```

Expand All @@ -56,7 +54,9 @@ Then make sure the following Babel config is present.
```javascript
// .babelrc
{
"presets": ["env", "preact"]
"presets": [
"preact"
]
}
```

Expand Down
16 changes: 14 additions & 2 deletions src/i18n/en/docs/transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,29 @@ This even works in third-party `node_modules`: if a configuration file is publis
Install presets and plugins in your app:

```bash
yarn add babel-preset-env
yarn add babel-preset-react
```

Then, create a `.babelrc`:

```json
{
"presets": ["env"]
"presets": [
"react"
]
}
```

### Default babel transforms

Parcel transpiles your code with `babel-preset-env` by default, this is to transpile every module both internal (local requires) and external (node_modules) to match the defined target.

For the `browser` target it utilises [browserlist](https://github.com/browserslist/browserslist), the target browserlist can be defined in `package.json` (`engines.browsers` or `browserslist`) or using a configuration file (`browserslist` or `.browserslistrc`).

The browserlist target defaults to: `> 0.25%` (Meaning, support every browser that has 0.25% or more of the total amount of active web users)

For the `node` target, Parcel uses the `engines.node` defined in `package.json`, this default to *node 8*.

## PostCSS

[PostCSS](http://postcss.org) is a tool for transforming CSS with plugins, like [autoprefixer](https://github.com/postcss/autoprefixer), [cssnext](http://cssnext.io/), and [CSS Modules](https://github.com/css-modules/css-modules). You can configure PostCSS with Parcel by creating a configuration file using one of these names: `.postcssrc` (JSON), `.postcssrc.js`, or `postcss.config.js`.
Expand Down

0 comments on commit 5709c09

Please sign in to comment.