From dc1df4f3b1318924d34d2391e7c8bea8c86ff352 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Tue, 22 May 2018 16:08:30 -0700 Subject: [PATCH] Update webpack.md --- modular_js/webpack.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 + } + } + } + ] + } +}; +```