|
@@ -3,7 +3,7 @@ const { defineConfig } = require('@vue/cli-service')
|
|
const WriteFilePlugin = require('write-file-webpack-plugin')
|
|
const WriteFilePlugin = require('write-file-webpack-plugin')
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
|
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
|
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
|
-const fs = require('fs')
|
|
|
|
|
|
+// const fs = require('fs')
|
|
// 配置编辑器
|
|
// 配置编辑器
|
|
const Timestamp = new Date().getTime()
|
|
const Timestamp = new Date().getTime()
|
|
|
|
|
|
@@ -92,23 +92,23 @@ module.exports = defineConfig({
|
|
return options
|
|
return options
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- config.plugin('generate-version-file').use({
|
|
|
|
- apply: (compiler) => {
|
|
|
|
- // 生成当前时间戳
|
|
|
|
- // const timestamp = Date.now()
|
|
|
|
|
|
+ // config.plugin('generate-version-file').use({
|
|
|
|
+ // apply: (compiler) => {
|
|
|
|
+ // // 生成当前时间戳
|
|
|
|
+ // // const timestamp = Date.now()
|
|
|
|
|
|
- // 构造 version.json 内容
|
|
|
|
|
|
+ // // 构造 version.json 内容
|
|
|
|
|
|
- const versionData = {
|
|
|
|
- version: Timestamp
|
|
|
|
- }
|
|
|
|
|
|
+ // const versionData = {
|
|
|
|
+ // version: Timestamp
|
|
|
|
+ // }
|
|
|
|
|
|
- // 写入 version.json 文件
|
|
|
|
- if (process.env.NODE_ENV === 'production') {
|
|
|
|
- fs.writeFileSync('./public/version.json', JSON.stringify(versionData, null, 2))
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // // 写入 version.json 文件
|
|
|
|
+ // if (process.env.NODE_ENV === 'production') {
|
|
|
|
+ // fs.writeFileSync('./public/version.json', JSON.stringify(versionData, null, 2))
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
// config.output.chunkFilename('js/[name].[contenthash].js').end()
|
|
// config.output.chunkFilename('js/[name].[contenthash].js').end()
|
|
},
|
|
},
|
|
// babel-loader 是否处理 node_modules 中的依赖包,处理哪些依赖包,参数类型: boolean | Array<string | RegExp>
|
|
// babel-loader 是否处理 node_modules 中的依赖包,处理哪些依赖包,参数类型: boolean | Array<string | RegExp>
|