Moved entry and HtmlWebpackPlugin from Vinlottis.config to webpack.common and webpack.prod. Removed Vinlottis.config.
This commit is contained in:
@@ -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;
|
|
||||||
@@ -15,7 +15,10 @@ const webpackConfig = function(isDev) {
|
|||||||
"@": helpers.root("src")
|
"@": helpers.root("src")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
externals: {
|
entry: {
|
||||||
|
vinlottis: helpers.root("src", "vinlottis-init")
|
||||||
|
},
|
||||||
|
externals: {
|
||||||
moment: 'moment' // comes with chart.js
|
moment: 'moment' // comes with chart.js
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
|
|||||||
@@ -40,9 +40,6 @@ let webpackConfig = merge(commonConfig(true), {
|
|||||||
});
|
});
|
||||||
|
|
||||||
webpackConfig = merge(webpackConfig, {
|
webpackConfig = merge(webpackConfig, {
|
||||||
entry: {
|
|
||||||
main: helpers.root("src", "vinlottis-init")
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new HtmlPlugin({
|
new HtmlPlugin({
|
||||||
template: "src/templates/Index.html"
|
template: "src/templates/Index.html"
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ if (environment === "development") {
|
|||||||
module.exports = require("./config/webpack.config.dev");
|
module.exports = require("./config/webpack.config.dev");
|
||||||
} else {
|
} else {
|
||||||
let prodConfig = require("./config/webpack.config.prod");
|
let prodConfig = require("./config/webpack.config.prod");
|
||||||
|
|
||||||
prodConfig = merge(prodConfig, require("./config/vinlottis.config.js"));
|
|
||||||
let serviceWorkerConfig = require("./config/service-worker.config.js");
|
let serviceWorkerConfig = require("./config/service-worker.config.js");
|
||||||
|
|
||||||
module.exports = [prodConfig, serviceWorkerConfig];
|
module.exports = [prodConfig, serviceWorkerConfig];
|
||||||
|
|||||||
Reference in New Issue
Block a user