From aa19744ae40767b2523ac0117792b47e08209cdf Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 22 Jun 2017 15:37:09 +0300 Subject: Webpack 3, chunknames in templates --- juick-www/webpack.config.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'juick-www/webpack.config.js') diff --git a/juick-www/webpack.config.js b/juick-www/webpack.config.js index 383c62a5..f4e41ecf 100644 --- a/juick-www/webpack.config.js +++ b/juick-www/webpack.config.js @@ -1,19 +1,23 @@ var webpack = require("webpack") -var globby = require("globby") var ExtractTextPlugin = require("extract-text-webpack-plugin") var StyleLintPlugin = require('stylelint-webpack-plugin') +var AssetPipelinePlugin = require('webpack-asset-pipeline') + module.exports = { devtool: 'source-map', entry: { - "scripts" : globby.sync([ - __dirname + "/src/main/static/*.*", - require.resolve('evil-icons/assets/evil-icons.css'), + "scripts" : [ + __dirname + "/src/main/static/scripts.js", require.resolve('evil-icons/assets/evil-icons.js') - ]) + ], + "style" : [ + __dirname + "/src/main/static/style.css", + require.resolve('evil-icons/assets/evil-icons.css') + ] }, output: { - path: __dirname + "/src/main/webapp", - filename: "[name].js" + path: __dirname + "/src/main/resources", + filename: "[name].[chunkhash].js" }, module: { loaders: [ @@ -25,8 +29,10 @@ module.exports = { ] }, plugins: [ + new webpack.optimize.ModuleConcatenationPlugin(), new StyleLintPlugin({ configFile: '.stylelintrc.json', context: 'src/main/static', files: ['**/*.css'], emitErrors: false }), - new ExtractTextPlugin({ filename: "style.css", allChunks: true }) + new ExtractTextPlugin({ filename: "style.[chunkhash].css", allChunks: true }), + new AssetPipelinePlugin() ], } \ No newline at end of file -- cgit v1.2.3