2018-12-25 17:50

vue-cli 打包文件报错

vue-cli 打包文件报错


> canteen@1.0.0 build D:\桌面\workPlace\07.items\06..canteen
> node build/build.js

/ building for production...Error processing file: static/css/app.9e1b2591f3911ed3227be61dd300833e.css
(node:1908) UnhandledPromiseRejectionWarning: postcss-svgo: Error in parsing SVG: Unquoted attribute value
Line: 0
Column: 14
Char: \
(node:1908) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:1908) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  • 也修改了 config/index.js 下面的 build
build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: './',

     * Source Maps

    productionSourceMap: false,
    devtool: '#source-map',

    // 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'],

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • q395212409 依稀的回忆 2年前

    如果是iconfont的话 记忆直接在index.html里面直接引入即可

    点赞 评论 复制链接分享
  • weixin_43965839 夜色不再 3年前

    你用的一些css样式不是自己写的,也不是通过npm 安装的,而里面却有svg,要改下

    点赞 评论 复制链接分享