diff --git a/package.json b/package.json index 4367288..0308bf4 100644 --- a/package.json +++ b/package.json @@ -36,13 +36,15 @@ "gsap": "^1.18.0", "gulp": "^3.9.0", "gulp-shell": "^0.5.2", + "hard-source-webpack-plugin": "^0.3.9", "howler": "^2.0.2", "json-loader": "^0.5.4", "lodash": "^4.17.4", + "node-object-hash": "^1.1.5", "pixi.js": "^4.3.4", "script-loader": "^0.7.0", "tween.js": "^16.6.0", "webpack": "^2.2.1", - "webpack-dev-server": "^1.16.3" + "webpack-dev-server": "^2.3.0" } } diff --git a/webpack.config.js b/webpack.config.js index f4e25d4..604ac5d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,7 @@ var path = require('path'); var webpack = require('webpack'); +var HardSourcePlugin = require('hard-source-webpack-plugin'); module.exports = { context: __dirname, @@ -9,7 +10,7 @@ module.exports = { duckhunt: './main.js', }, output: { - path: 'dist', + path: path.join(__dirname, 'dist'), filename: '[name].js', }, devtool: 'source-map', @@ -46,5 +47,12 @@ module.exports = { port: 8080 }, plugins: [ + new HardSourcePlugin({ + cacheDirectory: '../node_modules/.cache/hardsource/[confighash]', + recordsPath: '../node_modules/.cache/hardsource/[confighash]/records.json', + configHash: function(webpackConfig) { + return require('node-object-hash')().hash(webpackConfig); + } + }) ], }; \ No newline at end of file