|
|
|
@ -21,6 +21,8 @@ npm init
|
|
|
|
npm install webpack --save-dev
|
|
|
|
npm install webpack --save-dev
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you're asked, install `webpack-cli` as well.
|
|
|
|
|
|
|
|
|
|
|
|
Create a test file:
|
|
|
|
Create a test file:
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
@ -43,7 +45,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`):
|
|
|
|
|