67 lines
1.9 KiB
JavaScript
67 lines
1.9 KiB
JavaScript
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
module.exports = {
|
|
publicPath: "./",
|
|
outputDir: "wap",
|
|
productionSourceMap: false,
|
|
filenameHashing: true,
|
|
devServer: {
|
|
// https:true,
|
|
host: "0.0.0.0",
|
|
disableHostCheck: false,
|
|
proxy: {
|
|
"/api": {
|
|
target: process.env.VUE_APP_HOST,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
chainWebpack: (config) => {
|
|
const oneOfsMap = config.module.rule("scss").oneOfs.store;
|
|
oneOfsMap.forEach((item) => {
|
|
item.use("sass-resources-loader")
|
|
.loader("sass-resources-loader")
|
|
.options({
|
|
resources: "./src/assets/scss/common.scss",
|
|
})
|
|
.end();
|
|
});
|
|
|
|
// config.plugin('compression').use(
|
|
// new CompressionWebpackPlugin({
|
|
// filename: info => `${info.path}.gz${info.query}`,
|
|
// algorithm: 'gzip',
|
|
// threshold: 10240,
|
|
// test: /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i,
|
|
// minRatio: 0.8,
|
|
// deleteOriginalAssets: true
|
|
// })
|
|
// )
|
|
|
|
// config.resolve.plugins.delete('prefetch');
|
|
// config.resolve.plugins.delete('prerload');
|
|
},
|
|
configureWebpack: (config) => {
|
|
config.plugins.forEach((plugin) => {
|
|
if (plugin instanceof HtmlWebpackPlugin) {
|
|
plugin.options.title = "自在福田 - 寺庙联盟";
|
|
}
|
|
});
|
|
},
|
|
css: {
|
|
sourceMap: false,
|
|
loaderOptions: {
|
|
sass: {
|
|
sassOptions: {
|
|
silenceDeprecations: ["legacy-js-api", "import"],
|
|
},
|
|
},
|
|
scss: {
|
|
sassOptions: {
|
|
silenceDeprecations: ["legacy-js-api", "import"],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|