12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- // const targetUrl = 'http://192.168.1.220/'
- // const targetUrl = 'http://192.168.1.218/'
- // const targetUrl = 'http://dd.guozipay.com/'
- const targetUrl = 'https://admin.xyzshops.cn/'
- // const targetUrl = 'https://test.xyzshops.cn/'
- // 椰子临时线上
- // const targetUrl = 'http://121.89.196.45/'
- //椰林接口地址
- // const targetUrl = 'https://ylweb.xyzshops.cn/';
- module.exports = {
- publicPath:'./',
- productionSourceMap: false,
- 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: '椰林充值后台管理系统程序',
- },
- },
- devServer: {
- open: true,
- // host: 'localhost',
- host: '192.168.1.218',
- port: 3333,
- https: false,
- //以上的ip和端口是我们本机的;下面为需要跨域的
- proxy: {//配置跨域
- '/api': {
- target: targetUrl,//这里后台的地址模拟的;应该填写你们真实的后台接口
- ws: true,
- changOrigin: true,//允许跨域
- pathRewrite: {
- '^/api': ''//请求的时候使用这个api就可以
- }
- },
- }
- },
- chainWebpack: config => {
- config.module
- .rule("css")
- .test(/\.css$/)
- .oneOf("vue")
- .resourceQuery(/\?vue/)
- .use("px2rem")
- .loader("px2rem-loader")
- .options({
- // remUnit: 192
- remUnit: 210
- });
- },
- // 打包去掉console.log
- // configureWebpack: (config) => {
- // if (process.env.NODE_ENV === 'production') {
- // config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
- // }
- // }
- }
|