no message
Showing
2 changed files
with
34 additions
and
1 deletions
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | <div class="about"> | 2 | <div class="about"> |
| 3 | <h1>This is an about page</h1> | 3 | <h1>This is an about page</h1> |
| 4 | <div class="cc"> | 4 | <div class="cc"> |
| 5 | <div class="ddd"></div> | 5 | <div class="ddd">1233</div> |
| 6 | </div> | 6 | </div> |
| 7 | </div> | 7 | </div> |
| 8 | </template> | 8 | </template> | ... | ... |
| 1 | const Timestamp = new Date().getTime(); | ||
| 2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
| 1 | // 打包目录 | 3 | // 打包目录 |
| 2 | let webpack_public_path = 'dist' | 4 | let webpack_public_path = 'dist' |
| 3 | if (process.env.NODE_ENV === 'production') { | 5 | if (process.env.NODE_ENV === 'production') { |
| 4 | webpack_public_path = process.env.VUE_APP_TITLE | 6 | webpack_public_path = process.env.VUE_APP_TITLE |
| 5 | } | 7 | } |
| 6 | module.exports = { | 8 | module.exports = { |
| 9 | configureWebpack: { // webpack 配置 | ||
| 10 | // 修改打包后js文件名 | ||
| 11 | output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】 | ||
| 12 | filename: `static/js/[name].${Timestamp}.js`, | ||
| 13 | chunkFilename: `static/js/[name].${Timestamp}.js` | ||
| 14 | }, | ||
| 15 | // 修改打包后css文件名 | ||
| 16 | plugins: [ | ||
| 17 | new MiniCssExtractPlugin({ | ||
| 18 | filename: `static/css/[name].${Timestamp}.css`, | ||
| 19 | chunkFilename: `static/css/[name].${Timestamp}.css` | ||
| 20 | }) | ||
| 21 | ] | ||
| 22 | }, | ||
| 23 | // 修改打包后img文件名 | ||
| 24 | // chainWebpack: config => { | ||
| 25 | // config.module | ||
| 26 | // .rule('images') | ||
| 27 | // .use('url-loader') | ||
| 28 | // .tap(options => { | ||
| 29 | // return { | ||
| 30 | // limit: 4096, | ||
| 31 | // fallback: { | ||
| 32 | // loader: 'file-loader', | ||
| 33 | // options: { | ||
| 34 | // name: `img/[name].${Timestamp}.[ext]` | ||
| 35 | // } | ||
| 36 | // } | ||
| 37 | // }; | ||
| 38 | // }) | ||
| 39 | // }, | ||
| 7 | // 部署生产环境和开发环境下的URL。 | 40 | // 部署生产环境和开发环境下的URL。 |
| 8 | // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 | 41 | // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 |
| 9 | //例如 https://www.my-app.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.my-app.com/my-app/,则设置 baseUrl 为 /my-app/。 | 42 | //例如 https://www.my-app.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.my-app.com/my-app/,则设置 baseUrl 为 /my-app/。 | ... | ... |
-
Please register or sign in to post a comment