diff --git a/modular_js/webpack.md b/modular_js/webpack.md index 9a36efc..7d17a89 100644 --- a/modular_js/webpack.md +++ b/modular_js/webpack.md @@ -335,3 +335,30 @@ and it will open up your browser automatically. Change a file, and see it reloa ``` rm -r dist ``` + +Change your script tag to be + +```html + +``` + +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 + } + } + } + ] + } +}; +```