Correct a bunch of incorrect/outdated references (#2457)
- Babel 7 has a whole different module API - Traceur is basically dead - JSX != HTML - Some bits are just obvious from context what they are - ES6 docs shouldn't be auto-installing JSX support - Also, I decided it was worth clearing up some misleading docs in surrounding areas.
This commit is contained in:
parent
76e8eaab5e
commit
a23bcea7ee
6 changed files with 95 additions and 98 deletions
20
docs/es6.md
20
docs/es6.md
|
|
@ -24,19 +24,14 @@ If you want to use Webpack and Babel together, [skip to the section below](#usin
|
|||
To install Babel as a standalone tool, use this command:
|
||||
|
||||
```bash
|
||||
npm install babel-cli babel-preset-es2015 babel-plugin-transform-react-jsx --save-dev
|
||||
npm install @babel/cli @babel/preset-env --save-dev
|
||||
```
|
||||
|
||||
Create a `.babelrc` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["es2015"],
|
||||
"plugins": [
|
||||
["transform-react-jsx", {
|
||||
"pragma": "m"
|
||||
}]
|
||||
]
|
||||
"presets": ["@babel/preset-env"]
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -51,19 +46,14 @@ babel src --out-dir bin --source-maps
|
|||
If you're already using Webpack as a bundler, you can integrate Babel to Webpack by following these steps.
|
||||
|
||||
```bash
|
||||
npm install babel-core babel-loader babel-preset-es2015 babel-plugin-transform-react-jsx --save-dev
|
||||
npm install @babel/core babel-loader @babel/preset-env --save-dev
|
||||
```
|
||||
|
||||
Create a `.babelrc` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["es2015"],
|
||||
"plugins": [
|
||||
["transform-react-jsx", {
|
||||
"pragma": "m"
|
||||
}]
|
||||
]
|
||||
"presets": ["@babel/preset-env"]
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -81,7 +71,7 @@ module.exports = {
|
|||
module: {
|
||||
loaders: [{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
exclude: /\/node_modules\//,
|
||||
loader: 'babel-loader'
|
||||
}]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue