// const path = require('path')
module.exports = {
runtimeCompiler: true,
devServer: {
proxy: {
'/mock': {
target: 'https://easy-mock.com/mock/example',
// ws: true,
changeOrigin: true,
pathRewrite: {//重寫路徑
"^/mock": ''
}
},
'/api': {
target: 'http://~',//測試
// ws: true,
changeOrigin: true,
pathRewrite: {//重寫路徑
"^/api": ''
}
}
}
},
pluginOptions: {
'style-resources-loader': {
patterns: [
// main.js里全局引入css配置
// path.resolve(__dirname, './src/styles/*.scss')
],
preProcessor: 'scss'
}
},
css: {
// 向所有 Sass 樣式傳入共享的全局變量:
loaderOptions: {
// 給 sass-loader 傳遞選項
sass: {
// @/ 是 src/ 的別名
// 所以這里假設你有 `src/variables.scss` 這個文件
data: `@import "~@/styles/variables.scss";`
}
}
}
}