Version-handling

This commit is contained in:
Kasper Rynning-Tønnesen
2020-01-30 13:10:55 +01:00
parent 7a20115e28
commit e8a6284f02
6 changed files with 75 additions and 10 deletions

View File

@@ -0,0 +1,49 @@
"use strict";
const webpack = require("webpack");
const helpers = require("./helpers");
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
const ServiceWorkerConfig = {
resolve: {
extensions: [".js", ".vue"]
},
entry: {
serviceWorker: [helpers.root("public", "service-worker")]
},
optimization: {
minimizer: []
},
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
include: [helpers.root("public", "service-worker")]
}
]
},
mode: "production",
output: {
path: helpers.root("public/sw"),
publicPath: "/",
filename: "[name].js"
//filename: "js/[name].bundle.js"
},
optimization: {
minimizer: [
new UglifyJSPlugin({
cache: true,
parallel: false,
sourceMap: false
})
]
},
plugins: [
new webpack.DefinePlugin({
__DATE__: new Date().getTime()
})
]
};
module.exports = ServiceWorkerConfig;

View File

@@ -1,6 +1,7 @@
"use strict";
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const path = require("path");
const webpack = require("webpack");
const merge = require("webpack-merge");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
@@ -19,7 +20,7 @@ const webpackConfig = merge(commonConfig(false), {
path: helpers.root("public/dist"),
publicPath: "/dist/",
filename: "js/[name].bundle.[hash:7].js"
//filename: 'js/[name].bundle.js'
//filename: "js/[name].bundle.js"
},
optimization: {
splitChunks: {
@@ -50,6 +51,7 @@ const webpackConfig = merge(commonConfig(false), {
new webpack.EnvironmentPlugin(environment),
new MiniCSSExtractPlugin({
filename: "css/[name].[hash:7].css"
//filename: "css/[name].css"
})
]
});