Skip to content

Commit 19e448f

Browse files
authored
Merge pull request #26 from MattSurabian/hard-source
Add hard-source
2 parents 86247d0 + bd48476 commit 19e448f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636
"gsap": "^1.18.0",
3737
"gulp": "^3.9.0",
3838
"gulp-shell": "^0.5.2",
39+
"hard-source-webpack-plugin": "^0.3.9",
3940
"howler": "^2.0.2",
4041
"json-loader": "^0.5.4",
4142
"lodash": "^4.17.4",
43+
"node-object-hash": "^1.1.5",
4244
"pixi.js": "^4.3.4",
4345
"script-loader": "^0.7.0",
4446
"tween.js": "^16.6.0",
4547
"webpack": "^2.2.1",
46-
"webpack-dev-server": "^1.16.3"
48+
"webpack-dev-server": "^2.3.0"
4749
}
4850
}

webpack.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
var path = require('path');
44
var webpack = require('webpack');
5+
var HardSourcePlugin = require('hard-source-webpack-plugin');
56

67
module.exports = {
78
context: __dirname,
89
entry: {
910
duckhunt: './main.js',
1011
},
1112
output: {
12-
path: 'dist',
13+
path: path.join(__dirname, 'dist'),
1314
filename: '[name].js',
1415
},
1516
devtool: 'source-map',
@@ -46,5 +47,12 @@ module.exports = {
4647
port: 8080
4748
},
4849
plugins: [
50+
new HardSourcePlugin({
51+
cacheDirectory: '../node_modules/.cache/hardsource/[confighash]',
52+
recordsPath: '../node_modules/.cache/hardsource/[confighash]/records.json',
53+
configHash: function(webpackConfig) {
54+
return require('node-object-hash')().hash(webpackConfig);
55+
}
56+
})
4957
],
5058
};

0 commit comments

Comments
 (0)