Commit 8e350cfe by wangyalan-git

“打包添加前缀”

parent 38f33efb
const Timestamp = new Date().getTime() // const Timestamp = new Date().getTime()
const MiniCssExtractPlugin = require('mini-css-extract-plugin') // 表示自定义的系统配置 // const MiniCssExtractPlugin = require('mini-css-extract-plugin') // 表示自定义的系统配置
module.exports = { module.exports = {
assetsDir: 'goodsManage',
configureWebpack: { configureWebpack: {
output: { // output: {
// 输出重构【模块名称.hash值.时间戳】 // // 输出重构【模块名称.hash值.时间戳】
filename: `goodsManage/[name].[hash].${Timestamp}.js`, // filename: `goodsManage/[name].[hash].${Timestamp}.js`,
chunkFilename: `goodsManage/[name].[hash].${Timestamp}.js` // chunkFilename: `goodsManage/[name].[hash].${Timestamp}.js`
}, // },
plugins: [ // plugins: [
new MiniCssExtractPlugin({ // new MiniCssExtractPlugin({
// 修改打包后css文件名 // // 修改打包后css文件名
filename: `goodsManage/[name].[hash].${Timestamp}.css`, // filename: `goodsManage/[name].[hash].${Timestamp}.css`,
chunkFilename: `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
})
}, },
// 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: { css: {
loaderOptions: { loaderOptions: {
less: { less: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment