Update Webpack.md

master
Matt Huntington 8 years ago committed by GitHub
parent d3fd80b096
commit 4975dd5fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -43,7 +43,7 @@ mkdir dist
We can now run: We can now run:
``` ```
./node_modules/.bin/webpack js/index.js dist/bundle.js ./node_modules/.bin/webpack js/index.js -o dist/bundle.js
``` ```
Create a basic HTML file (`index.html`): Create a basic HTML file (`index.html`):
@ -167,7 +167,7 @@ Create `webpack.config.js` to simplify the terminal command
module.exports = { module.exports = {
entry: './js/index.js', entry: './js/index.js',
output: { output: {
filename: 'dist/bundle.js' filename: 'bundle.js'
} }
}; };
``` ```
@ -206,7 +206,7 @@ Modify the webpack config to use these:
module.exports = { module.exports = {
entry: './js/index.js', entry: './js/index.js',
output: { output: {
filename: 'dist/bundle.js' filename: 'bundle.js'
}, },
module: { module: {
rules: [ rules: [
@ -234,7 +234,7 @@ class Foo {
} }
``` ```
The result in `dist/build.js` is the ES5 version: The result in `dist/build.js` is the ES5 version (may be minified):
```javascript ```javascript
var Foo = function () { var Foo = function () {

Loading…
Cancel
Save