فهرست منبع

在webpack文件里面加时间错

Lijy 2 سال پیش
والد
کامیت
cc5bd9d303

+ 4 - 3
fhKeeper/formulahousekeeper/timesheet/build/webpack.prod.conf.js

@@ -8,6 +8,7 @@ var CopyWebpackPlugin = require('copy-webpack-plugin')
 var HtmlWebpackPlugin = require('html-webpack-plugin')
 var ExtractTextPlugin = require('extract-text-webpack-plugin')
 var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
+var version = new Date().getTime()
 
 var env = config.build.env
 
@@ -22,8 +23,8 @@ var 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
@@ -40,7 +41,7 @@ var webpackConfig = merge(baseWebpackConfig, {
         }),
         // extract css into its own file
         new ExtractTextPlugin({
-        filename: utils.assetsPath('css/[name].[contenthash].css')
+        filename: utils.assetsPath(`css/[name].[contenthash].${version}.css`)
         }),
         // Compress extracted CSS. We are using this plugin so that possible
         // duplicated CSS from different components can be deduped.

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/index.html

@@ -3,9 +3,9 @@
     <head>
         <meta charset="utf-8">
         <!-- 尝试清除打包缓存 -->
-        <meta http-equiv="pragram" content="no-cache">
+        <!-- <meta http-equiv="pragram" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
-        <meta http-equiv="expires" content="0">
+        <meta http-equiv="expires" content="0"> -->
         <!-- 尝试清除打包缓存 -->
         <title>工时管家</title>
         <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico"/>