Version-handling
This commit is contained in:
49
config/service-worker.config.js
Normal file
49
config/service-worker.config.js
Normal 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;
|
||||
@@ -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"
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user