NPM package Configure Prepare run scripts[配置执行脚本]
The final thing is to add three scripts entries into our package.json:
1 | { |
What we just did was to add 3 commands that can be run through npm run
serve - npm run serve - just starts an http-server serving files from our local dir, running on port 8080 (it serves index.html).
dev - npm run dev - starts webpack-dev-server on port 8090 which serves both the webpack-dev-server.js runtime and our bundle.js file.
start - npm run start - command simply executes serve first and then starts the dev server.
Launch【运行】
Now we are ready:
1 | $ npm run start |
If everything is fine, you should open localhost:8080