|
|
|
@ -335,3 +335,30 @@ and it will open up your browser automatically. Change a file, and see it reloa
|
|
|
|
```
|
|
|
|
```
|
|
|
|
rm -r dist
|
|
|
|
rm -r dist
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Change your script tag to be
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```html
|
|
|
|
|
|
|
|
<script src="main.js" charset="utf-8"></script>
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
And take out the `output` property in webpack.config.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
entry: './js/index.js',
|
|
|
|
|
|
|
|
module: {
|
|
|
|
|
|
|
|
rules: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
test: /\.(js|jsx)$/, //for all files that end with js/jsx
|
|
|
|
|
|
|
|
use: {
|
|
|
|
|
|
|
|
loader: 'babel-loader', //use the babel loader to load:
|
|
|
|
|
|
|
|
options: {
|
|
|
|
|
|
|
|
presets: ["es2015", "react"] //the es2015 compiler
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
```
|
|
|
|
|