标签:index false sse 找不到 跨域 root webpack analyzer cal
进入config>index.js把assetsPublicPath:‘/‘改成‘./‘;
build: { env: require(‘./prod.env‘), index: path.resolve(__dirname, ‘../dist/index.html‘), assetsRoot: path.resolve(__dirname, ‘../dist‘), assetsSubDirectory: ‘static‘, assetsPublicPath: ‘./‘, productionSourceMap: false, productionGzip: false, productionGzipExtensions: [‘js‘, ‘css‘] bundleAnalyzerReport: process.env.npm_config_report }
进入config>index.js把修改port:9090
module.exports = { dev: { assetsSubDirectory: ‘static‘, assetsPublicPath: ‘/ host: ‘localhost‘, port: 9090,
module.exports = { dev: { proxyTable: { ‘/dianping‘: { target: ‘http://****‘, changeOrigin: true, pathRewrite: { ‘^/dianping‘: ‘/dianping‘ //此字段根据自己项目填写 } } }
{ test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, loader: ‘url-loader‘, options: { // limit: 10000, name: utils.assetsPath(‘img/[name].[hash:7].[ext]‘) } },
在config\index.js 中把productionSourceMap:true改成productionSourceMap:false
build: { env: require(‘./prod.env‘), index: path.resolve(__dirname, ‘../dist/index.html‘), assetsRoot: path.resolve(__dirname, ‘../dist‘), assetsSubDirectory: ‘static‘, assetsPublicPath: ‘./‘, productionSourceMap: false, productionGzip: false, productionGzipExtensions: [‘js‘, ‘css‘] bundleAnalyzerReport: process.env.npm_config_report },
build文件里找到 utils.js 文件,修改如下: if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, publicPath: ‘../../‘, //解决 build css bg img 加载路径不对问题 (添加的就是这行) fallback: ‘vue-style-loader‘ }) } else { return [‘vue-style-loader‘].concat(loaders) } }
标签:index false sse 找不到 跨域 root webpack analyzer cal
原文地址:https://www.cnblogs.com/mahmud/p/11518647.html