const webpack = require('webpack') const path = require('path'); function resolve (dir) { return path.join(__dirname, dir) } // 项目的主要配置文件 module.exports = { publicPath: '', outputDir: './dist', productionSourceMap: false, lintOnSave: false, //启用并行化 默认并发运行数 os.cpus().length - 1 ,并行化可以显著加速构建 parallel: require('os').cpus().length > 1, configureWebpack: { plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'windows.jQuery': 'jquery', 'window.Quill': 'quill/dist/quill.js', 'Quill': 'quill/dist/quill.js' }), ] }, chainWebpack: (config)=>{ //修改文件引入自定义路径 config.resolve.alias .set('@', resolve('src')) config.resolve.alias .set('@utils', resolve('src/utils')) }, pages: { index: { // 页面入口 entry: 'src/main.js', // 模板来源 template: 'public/index.html', // 在 dist/index.html 的输出 filename: 'index.html', // 当使用 title 选项时, // template 中的 title 标签需要是