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