Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
h5
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vanke
h5
Commits
8e350cfe
Commit
8e350cfe
authored
Apr 21, 2021
by
wangyalan-git
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
“打包添加前缀”
parent
38f33efb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
29 deletions
+30
-29
vue.config.js
vue.config.js
+30
-29
No files found.
vue.config.js
View file @
8e350cfe
const
Timestamp
=
new
Date
().
getTime
()
const
MiniCssExtractPlugin
=
require
(
'mini-css-extract-plugin'
)
// 表示自定义的系统配置
//
const Timestamp = new Date().getTime()
//
const MiniCssExtractPlugin = require('mini-css-extract-plugin') // 表示自定义的系统配置
module
.
exports
=
{
assetsDir
:
'goodsManage'
,
configureWebpack
:
{
output
:
{
// 输出重构【模块名称.hash值.时间戳】
filename
:
`goodsManage/[name].[hash].
${
Timestamp
}
.js`
,
chunkFilename
:
`goodsManage/[name].[hash].
${
Timestamp
}
.js`
},
plugins
:
[
new
MiniCssExtractPlugin
({
// 修改打包后css文件名
filename
:
`goodsManage/[name].[hash].
${
Timestamp
}
.css`
,
chunkFilename
:
`goodsManage/[name].[hash].
${
Timestamp
}
.css`
})
]
},
chainWebpack
:
config
=>
{
config
.
module
.
rule
(
'images'
)
.
use
(
'url-loader'
)
.
tap
(
options
=>
{
options
.
name
=
`goodsManage/[name].[hash].
${
Timestamp
}
.[ext]`
options
.
fallback
=
{
loader
:
'file-loader'
,
options
:
{
name
:
`goodsManage/[name].[hash].
${
Timestamp
}
.[ext]`
}
}
return
options
})
// output: {
// // 输出重构【模块名称.hash值.时间戳】
// filename: `goodsManage/[name].[hash].${Timestamp}.js`,
// chunkFilename: `goodsManage/[name].[hash].${Timestamp}.js`
// },
// plugins: [
// new MiniCssExtractPlugin({
// // 修改打包后css文件名
// filename: `goodsManage/[name].[hash].${Timestamp}.css`,
// chunkFilename: `goodsManage/[name].[hash].${Timestamp}.css`
// })
// ]
},
// chainWebpack: config => {
// config.module
// .rule('images')
// .use('url-loader')
// .tap(options => {
// options.name = `goodsManage/[name].[hash].${Timestamp}.[ext]`
// options.fallback = {
// loader: 'file-loader',
// options: {
// name: `goodsManage/[name].[hash].${Timestamp}.[ext]`
// }
// }
// return options
// })
// },
css
:
{
loaderOptions
:
{
less
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment