const path = require('path') const webpack = require('webpack') function resolve(dir) { return path.join(__dirname, dir) } // vue.config.js module.exports = { pages: { index: { // page 的入口 entry: 'src/main.js', // 模板来源 template: 'public/index.html', // 在 dist/index.html 的输出 filename: 'index.html', // 当使用 title 选项时, // template 中的 title 标签需要是 <%= htmlWebpackPlugin.options.title %> title: '三维功能示例', // 在这个页面中包含的块,默认情况下会包含 // 提取出来的通用 chunk 和 vendor chunk。 chunks: ['chunk-vendors', 'chunk-common', 'index'] } }, // ...other config configureWebpack: { // webpack plugins plugins: [ // Ignore all locale files of moment.js new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/) ] }, productionSourceMap: false, //打包不生成js.map文件 chainWebpack: (config) => { config.resolve.alias .set('@$', resolve('src')) .set('@static', resolve('public/static')) }, css: { loaderOptions: { less: { modifyVars: { 'primary-color': '#F05A28', 'border-color-base': '#F05A28', 'heading-color': 'rgba(240, 90, 40, 1)', // 'text-color': 'rgba(240, 90, 40, 1)', 'link-color': '#F05A28' }, javascriptEnabled: true }, } }, pluginOptions: { "style-resources-loader": { preProcessor: "less", patterns: [ path.resolve(__dirname, 'src/assets/common/less/variable.less') ] } }, devServer: { port: 2001, proxy: { '/proxy_oauth/': { target: 'http://121.43.55.7:10086', changeOrigin: true, pathRewrite: { '^/proxy_oauth': '' } }, } } }