12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- const path = require('path')
- function resolve(dir) {
- return path.join(__dirname, dir)
- }
- module.exports = {
- outputDir: '../../public/weworksingle/',
- indexPath: '../../public/weworksingle.html',
- productionSourceMap: false, // 关键语句
- publicPath: process.env.NODE_ENV === 'production' ? './weworksingle/' : '',
- css: {
- // 是否使用css分离插件 ExtractTextPlugin
- // extract: true,
- // 开启 CSS source maps?
- sourceMap: false,
- // css预设器配置项
- loaderOptions: {
- postcss: {
- plugins: [
- require('postcss-px2rem-exclude')({ //配置项,详见官方文档
- remUnit: 75, // 换算的基数
- exclude: /node_modules/
- })
- ]
- },
- less: {
- javascriptEnabled: true,
- globalVars: {
- primary: '#fff'
- }
- }
- },
- requireModuleExtension: true
- },
- devServer: {
- proxy: {
- "/client": {
- // zhuangqixiaoguan.com
- // saasdev.zhuangqixiaoguan.com
- // wework.weizhihui.ink
- target: "https://wework.zqxg.cc/client", //设置你调用的接口域名和端口号 别忘了加http、https
- changeOrigin: true, //是否跨域
- // secure: true, // 允许https请求
- ws: true,
- pathRewrite: {
- "^/client": "" //这里理解成用‘/api’代替target里面的地址
- }
- },
- "/api": {
- target: "https://wework.zqxg.cc/api", //设置你调用的接口域名和端口号 别忘了加http、https
- changeOrigin: true, //是否跨域
- // secure: true, // 允许https请求
- ws: true,
- pathRewrite: {
- "^/api": "" //这里理解成用‘/api’代替target里面的地址
- }
- },
- "/index": {
- target: "https://wework.zqxg.cc/index", //设置你调用的接口域名和端口号 别忘了加http、https
- changeOrigin: true, //是否跨域
- // secure: true, // 允许https请求
- ws: true,
- pathRewrite: {
- "^/index": "" //这里理解成用‘/api’代替target里面的地址
- }
- }
- }
- }
- }
|