Files
rootandClaude Opus 5 e282bd23e8 Switch to dart-sass and make deploy script fail-safe
node-sass 4.x cannot build on arm64/Node 16. Use sass with ::v-deep
instead of /deep/, and only replace the server dist after the upload
is unpacked and verified.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 19:18:37 +08:00

36 lines
809 B
JavaScript

/*
* @Author: 王枫叶
* @Date: 2020-10-31 17:53:35
* @LastEditors: 王枫叶
* @LastEditTime: 2020-11-04 14:41:28
*/
// gzip压缩配置
const CompressionPlugin = require("compression-webpack-plugin")
module.exports = {
publicPath: './',
configureWebpack: () => {
if (process.env.NODE_ENV === "production") {
return {
plugins: [
new CompressionPlugin({
test: /\.js$|\.css$|\.html$|\.mp4$/, //匹配文件名
threshold: 10240, //对超出10k对数据进行压缩
deleteOriginalAssets: false //是否删除文件
})
]
};
}
},
css: {
loaderOptions: {
sass: {
implementation: require('sass'),
data: `@import "@/assets/scss/base.scss";`
}
}
},
}