41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
const config = require("./src/config");
|
|
const proxy = require("./proxy.config");
|
|
module.exports = {
|
|
publicPath: "./",
|
|
outputDir: "dist",
|
|
assetsDir: "static",
|
|
indexPath: "index.html",
|
|
pages: {
|
|
index: {
|
|
// page 的入口
|
|
entry: "src/main.js",
|
|
// 模板来源
|
|
template: "public/index.html",
|
|
// 在 dist/index.html 的输出
|
|
filename: "index.html",
|
|
// 当使用 title 选项时,
|
|
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
|
|
title: config.appName,
|
|
// 在这个页面中包含的块,默认情况下会包含
|
|
// 提取出来的通用 chunk 和 vendor chunk。
|
|
chunks: ["chunk-vendors", "chunk-common", "index"]
|
|
}
|
|
},
|
|
devServer: {
|
|
proxy: proxy
|
|
},
|
|
css: {
|
|
loaderOptions: {
|
|
postcss: {},
|
|
less: {
|
|
lessOptions: {
|
|
modifyVars: {
|
|
// 或者可以通过 less 文件覆盖(文件路径为绝对路径)
|
|
hack: `true; @import "@/styles/cover.less";`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|