From 9b0c2bedc57ba6862cb79e09e5651a5cdb1a1311 Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Tue, 3 May 2022 12:20:42 +0800 Subject: [PATCH] 去缓存 --- build/webpack.base.conf.js | 4 +--- build/webpack.prod.conf.js | 7 ++++--- dist.zip | Bin 268403 -> 0 bytes index.html | 9 +++++---- package-lock.json | 17 +++++++++++++++++ package.json | 1 + vue.config.js | 9 ++++++++- 7 files changed, 36 insertions(+), 11 deletions(-) diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index a07e683..0455e83 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -12,9 +12,7 @@ function resolve (dir) { module.exports = { context: path.resolve(__dirname, '../'), - entry: { - app: './src/main.js' - }, + entry: ['babel-polyfill', './src/main.js'], output: { path: config.build.assetsRoot, filename: '[name].js', diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 34c64e4..898deba 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -12,7 +12,8 @@ const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const env = require('../config/prod.env') -const Version = new Date().getTime() + +const Version = new Date().getTime(); const webpackConfig = merge(baseWebpackConfig, { module: { rules: utils.styleLoaders({ @@ -25,8 +26,8 @@ const webpackConfig = merge(baseWebpackConfig, { output: { publicPath: './', path: config.build.assetsRoot, - filename: utils.assetsPath('js/[name].[chunkhash].js'), - chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + filename: utils.assetsPath('js/[name].[chunkhash]'+Version+'.js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash]'+Version+'.js') }, plugins: [ // http://vuejs.github.io/vue-loader/en/workflow/production.html diff --git a/dist.zip b/dist.zip index 1e29288..0f8a8da 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/index.html b/index.html index b7c3389..ce154de 100644 --- a/index.html +++ b/index.html @@ -4,10 +4,11 @@ - - - - + + + + +