码迷,mamicode.com
首页 > 其他好文 > 详细

从github下载的vue项目启动宝Cannot Get错误

时间:2018-08-03 14:33:21      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:rod   vue   npm   log   block   --   nal   stat   make   

从github下载的vue项目启动宝Cannot Get错误,网上参考出现该错误来源很多,这里先总结遇到的第一个解决方法。

参考地址:

https://www.cnblogs.com/anns/p/7457952.html

代码修改如下:

在config-》index.js中修改 assetsPublicPath: ‘/‘, 为 assetsPublicPath: ‘./‘, 再执行 npm run dev ,问题解决

 build: {
        env: require(‘./prod.env‘),
        index: path.resolve(__dirname, ‘../dist/modules/index/index.html‘),
        phone: path.resolve(__dirname, ‘../dist/modules/phone/phone.html‘),
        assetsRoot: path.resolve(__dirname, ‘../dist‘),
        assetsSubDirectory: ‘static‘,
        assetsPublicPath: ‘./‘,
        productionSourceMap: true,
        // Gzip off by default as many popular static hosts such as
        // Surge or Netlify already gzip all static assets for you.
        // Before setting to `true`, make sure to:
        // npm install --save-dev compression-webpack-plugin
        productionGzip: false,
        productionGzipExtensions: [‘js‘, ‘css‘],
        bundleAnalyzerReport: process.env.npm_config_report
    },

注意,不能更改dev下的代码。

附上下来项目的来源:

https://github.com/chen1218chen/vue-cli-multi-page

从github下载的vue项目启动宝Cannot Get错误

标签:rod   vue   npm   log   block   --   nal   stat   make   

原文地址:https://www.cnblogs.com/yyk1226/p/9413254.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!