zoukankan      html  css  js  c++  java
  • vue-cli多页面应用常遇到的问题

    1、TypeError: webpack.optimize.OccurenceOrderPlugin is not a constructor

    此问题出现在webpack 3中,解决办法很简单,将occurenceOrderPlugin改为OccurrenceOrderPlugin即可。

    2、ReferenceError: rm is not defined

    在build.js中,引入:

    require('shelljs/global')

    3、WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

    - configuration.resolve.extensions[0] should not be empty.
    -> A non-empty string

    复制代码
    resolve: {
      extensions: ['', '.js', '.jsx']
    },
    //删除:'',改为:
    resolve: {
      extensions: ['.js', '.jsx']
    },
    复制代码

    4、

    WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
    - configuration.resolve has an unknown property 'fallback'.

    5、

    ERROR in Entry module not found: Error: Can't resolve 'babel' in '/Users/xxx/ideaProjects/xxx'
    BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
    You need to specify 'babel-loader' instead of 'babel',
    see https://webpack.js.org/guides/migrating/#automatic-loader-module-name-extension-removed

    loader不能用简写省去 -loader 的形式。因此vue-loader应该使用全拼的形式。 babel-loader也是

    6、context.compiler.hooks.invalid.tap('WebpackDevMiddleware', invalid);

                             ^
    
    TypeError: Cannot read property 'invalid' of undefined

    1、卸载webpack-dev-middleware ,执行npm uninstall webpack-dev-middleware,使用dev-server自带的webpack-dev-middleware

    2、重新install webpack-dev-server, 执行 npm install webpack-dev-server --save-dev

     
  • 相关阅读:
    叉积与点积
    Vector3 *2 ,ToString()自动四舍五入
    "无法删除数据库,因为该数据库当前正在使用"问题解决
    感谢信
    实变函数一窥
    北京大学2015年数学分析考研试题
    象棋是门残忍的艺术---续篇
    象棋是门残忍的艺术
    赣南师范学院教师高级专业技术资格评审委员会评审通过人员公示名单
    [再寄小读者之数学篇](2014-12-24 乘积型不等式)
  • 原文地址:https://www.cnblogs.com/chenglideyueguang/p/9669688.html
Copyright © 2011-2022 走看看