Moved entry and HtmlWebpackPlugin from Vinlottis.config to webpack.common and webpack.prod. Removed Vinlottis.config.

This commit is contained in:
2020-11-24 23:54:43 +01:00
parent 055d13af35
commit ccc72997c0
4 changed files with 4 additions and 34 deletions

View File

@@ -1,28 +0,0 @@
"use strict";
const HtmlWebpackPlugin = require("html-webpack-plugin");
const helpers = require("./helpers");
const VinlottisConfig = {
entry: {
vinlottis: helpers.root("src", "vinlottis-init")
},
optimization: {
minimizer: [
new HtmlWebpackPlugin({
chunks: ["vinlottis"],
filename: "index.html",
template: "./src/templates/Index.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
preserveLineBreaks: true,
removeAttributeQuotes: true
}
})
]
}
};
module.exports = VinlottisConfig;

View File

@@ -15,6 +15,9 @@ const webpackConfig = function(isDev) {
"@": helpers.root("src")
}
},
entry: {
vinlottis: helpers.root("src", "vinlottis-init")
},
externals: {
moment: 'moment' // comes with chart.js
},

View File

@@ -40,9 +40,6 @@ let webpackConfig = merge(commonConfig(true), {
});
webpackConfig = merge(webpackConfig, {
entry: {
main: helpers.root("src", "vinlottis-init")
},
plugins: [
new HtmlPlugin({
template: "src/templates/Index.html"

View File

@@ -7,8 +7,6 @@ if (environment === "development") {
module.exports = require("./config/webpack.config.dev");
} else {
let prodConfig = require("./config/webpack.config.prod");
prodConfig = merge(prodConfig, require("./config/vinlottis.config.js"));
let serviceWorkerConfig = require("./config/service-worker.config.js");
module.exports = [prodConfig, serviceWorkerConfig];