Skip to content

Commit

Permalink
cleans up package.json. sets up hot reloading. updates to webpack 2
Browse files Browse the repository at this point in the history
  • Loading branch information
minaorangina committed Apr 19, 2017
1 parent fdce293 commit e647477
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
1 change: 0 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<body>
<div class="container"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.6/socket.io.js"></script>
<script src="fakebundle.js" charset="utf-8"></script>
<script src="bundle.js" charset="utf-8"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"scripts": {
"start": "node start.js",
"start-dev": "nodemon start.js",
"build-hot": "node_modules/.bin/webpack-dev-server --config webpack.dev.config.js",
"dev": "node ./src/utils/dev-server.js",
"postinstall": "webpack --config webpack.production.config.js",
"build": "webpack --config webpack.dev.config.js",
"env": "source ./env.sh",
"lint": "eslint src/**/*.js server/**/*.js test/**/*.js",
"test": "tape --require babel-register --require ignore-styles --require ./test/utils/test_helpers.js 'test/tape/**/*.es6'",
"test:mocha": "node_modules/mocha/bin/mocha --compilers js:babel-core/register --require ./test/utils/test_helpers.js 'test/unit/**/*.@(js|jsx)'"
Expand Down Expand Up @@ -53,7 +53,7 @@
"soap": "0.11.4",
"socket.io": "^1.5.0",
"style-loader": "^0.13.1",
"webpack": "1.13.2"
"webpack": "^2.4.1"
},
"devDependencies": {
"babel-eslint": "^7.0.0",
Expand All @@ -66,6 +66,6 @@
"react-addons-test-utils": "^15.3.2",
"react-hot-loader": "^3.0.0-beta.6",
"tap-spec": "^4.1.1",
"webpack-dev-server": "^1.16.2"
"webpack-dev-server": "^2.4.2"
}
}
29 changes: 17 additions & 12 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,28 @@ module.exports = {
"webpack/hot/dev-server",
"webpack-dev-server/client?http://localhost:8080/"
],
entry: './src/js/app.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: "babel-loader",
exclude: /node_modules/
},
{
test: /\.scss$/,
loaders: ["style-loader", "css-loader", "sass-loader"]
}
rules: [
{ test: /\.js$/, exclude: /node_modules/, use: 'babel-loader' },
{ test: /\.s?css$/, use: ['style-loader', 'css-loader', 'sass-loader'] }
]
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000,
hot: true,
proxy: {
'*': {
target: 'http://localhost:9009'
}
}
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
Expand Down

0 comments on commit e647477

Please sign in to comment.