From 16be7cb28a47486db90570d200fd93be54fbb1c3 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Wed, 26 Dec 2018 00:39:30 +0000 Subject: [PATCH] Fixed grunt-webpack circular reference issue --- Gruntfile.js | 72 +++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1d254791..61576278 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -180,42 +180,44 @@ module.exports = function (grunt) { }, webpack: { options: webpackConfig, - web: { - mode: "production", - target: "web", - entry: Object.assign({ - main: "./src/web/index.js", - sitemap: "./src/web/static/sitemap.js" - }, moduleEntryPoints), - output: { - path: __dirname + "/build/prod" - }, - resolve: { - alias: { - "./config/modules/OpModules": "./config/modules/Default" - } - }, - plugins: [ - new webpack.DefinePlugin(BUILD_CONSTANTS), - new HtmlWebpackPlugin({ - filename: "index.html", - template: "./src/web/html/index.html", - chunks: ["main"], - compileTime: compileTime, - version: pkg.version, - minify: { - removeComments: true, - collapseWhitespace: true, - minifyJS: true, - minifyCSS: true + web: () => { + return { + mode: "production", + target: "web", + entry: Object.assign({ + main: "./src/web/index.js", + sitemap: "./src/web/static/sitemap.js" + }, moduleEntryPoints), + output: { + path: __dirname + "/build/prod" + }, + resolve: { + alias: { + "./config/modules/OpModules": "./config/modules/Default" } - }), - new BundleAnalyzerPlugin({ - analyzerMode: "static", - reportFilename: "BundleAnalyzerReport.html", - openAnalyzer: false - }), - ] + }, + plugins: [ + new webpack.DefinePlugin(BUILD_CONSTANTS), + new HtmlWebpackPlugin({ + filename: "index.html", + template: "./src/web/html/index.html", + chunks: ["main"], + compileTime: compileTime, + version: pkg.version, + minify: { + removeComments: true, + collapseWhitespace: true, + minifyJS: true, + minifyCSS: true + } + }), + new BundleAnalyzerPlugin({ + analyzerMode: "static", + reportFilename: "BundleAnalyzerReport.html", + openAnalyzer: false + }), + ] + }; }, webInline: { mode: "production",