webpack/webpack-dev-server#474 Example
npm install
npm rub-script server
- Open browser on
http://localhost:8080/webpack-dev-server/index.html
.idea/ | |
node_modules/ | |
build/ |
npm install
npm rub-script server
http://localhost:8080/webpack-dev-server/index.html
console.log('Bundle loaded'); |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
{ | |
"name": "wds474", | |
"version": "1.0.0", | |
"main": "entry.js", | |
"scripts": { | |
"server": "webpack-dev-server" | |
}, | |
"license": "UNLICENSED", | |
"dependencies": { | |
"webpack": "^1.13.2", | |
"webpack-dev-server": "^1.15.1" | |
} | |
} |
var path = require('path'); | |
module.exports = { | |
entry: path.resolve(__dirname, 'entry.js'), | |
output: { | |
path: path.resolve(__dirname, 'build'), | |
filename: 'bundle.js' | |
} | |
}; |