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
vue-cli多页面应用常遇到的问题的更多相关文章
- 8.0 vue cli自定义页面
1.新建a.html(public文件夹下)文件,并设定div的id="a" <!DOCTYPE html> <html lang=""> ...
- VUE cli 4.x下配置多页面以及同时配置支持element-ui及mint-ui并且优化首页文件大小。
场景,公司的一个小型项目,需同时支持移动端和PC端.最开始考虑做两个独立的项目.但后来考虑到总共只有4个功能页面,布署起来相对麻烦.所以决定做在一个项目里. 1.升级vue-cli到4.x npm i ...
- vue cli 3.x 项目部署到 github pages
github pages 是 github 免费为用户提供的服务,写博客,或者部署一些纯静态项目. 最近将 vue cli 3.x 初始化项目部署到 github pages,踩了一些坑,记录如下. ...
- vue cli 3 lintOnSave 配置有时无效问题
一个使用vue cli 3.2创建的项目,创建时未开启 lintOnSave,后来希望开启并设置为 lintOnSave: 'error',但配置不生效. 解决方法1:新创建项目(此时vue cli ...
- vue cli 3
介绍 Vue CLI 是一个基于 Vue.js 进行快速开发的完整系统 通过 @vue/cli 搭建交互式的项目脚手架. 通过 @vue/cli + @vue/cli-service-global 快 ...
- 运行vue项目--安装vue脚手架vue cli
第一步. 安装node: 官网下载node的.pkg,下载地址,选择相应版本进行下载 mac终端下输入npm -v 和 node -v, 出现相应版本号即安装成功. 若均提示 command not ...
- vue cli+axios踩坑记录+拦截器使用,代理跨域proxy(更新)
16319 1.首先axios不支持vue.use()方式声明使用,看了所有近乎相同的axios文档都没有提到这一点建议方式 在main.js中如下声明使用 import axios from 'ax ...
- vue cli+axios踩坑记录+拦截器使用,代理跨域proxy
1.首先axios不支持vue.use()方式声明使用,看了所有近乎相同的axios文档都没有提到这一点 建议方式 在main.js中如下声明使用 import axios from 'axios'; ...
- Vue Cli安装以及使用
因为公司项目要用vue框架,所以会用vue-cli来新建项目.用过vue的都知道,要全局安装vue以及脚手架vue-cli,然后执行vue init webpack projectname来新建v ...
- axios踩坑记录+拦截器使用+vue cli代理跨域proxy+webpack打包部署到服务器
1.小小的提一下vue cli脚手架前端调后端数据接口时候的本地代理跨域问题,如我在本地localhost访问接口http://40.00.100.100:3002/是要跨域的,相当于浏览器设置了一道 ...
随机推荐
- 手机H5,用Jquery使图片自动填满两栏式排版
遇上这样的排版,手机的解象度都不同,假如只用CSS3根本就做不出这样的排版:因此要用Jquery. 1. HTML <div class="postImgCenterCrop" ...
- python格式化输出的三种形式
法一: list_a = [1, 2, 3] str_b = 'aaa' string = "There are two contents:%s, %s" % (list_a, s ...
- 测试Java程序执行耗费的时间
package test; public class Main { public static void main(String[] args) { long start = System.curre ...
- no.2淘宝架构背后——零售业务中台架构设计探讨及实践读后感
2017年8月12日,袋鼠云首席架构师正风在“网易博学实践日:大数据与人工智能技术大会”进行<淘宝架构演进背后——零售业务中台架构设计探讨及实践>演讲分享.传统零售行业如何选择应对新经济模 ...
- Kali 时间修改
前言 装了新版本的 Kali 之后发现默认的时间和实际的时间不太一样 查了资料说 linux 的默认时间是格林威治时间,即从本初子午线为0时区 以下是 kali 修改时间的方法 1.tzselect ...
- 【YOLO学习】召回率(Recall),精确率(Precision),平均正确率(Average_precision(AP) ),交除并(Intersection-over-Union(IoU))
摘要 在训练YOLO v2的过程中,系统会显示出一些评价训练效果的值,如Recall,IoU等等.为了怕以后忘了,现在把自己对这几种度量方式的理解记录一下. 这一文章首先假设一个测试集,然后围绕这一测 ...
- Java实现卖票程序(两种线程实现)
/** * 2019年8月8日16:05:05 * 目的:实现火车站卖票系统(第一种创建线程的方式) * @author 张涛 * */ //第一种方式直接继承Thread来创建线程 class T1 ...
- TPO2-1Desert Formation
The extreme seriousness of desertification results from the vast areas of land and the tremendous nu ...
- Class<T> 泛型获取T的class
getClass().getGenericSuperclass()返回表示此 Class 所表示的实体(类.接口.基本类型或 void)的直接超类的 Type然后将其转换ParameterizedTy ...
- learning Perl:91行有啥用? 88 print "\n----------------------------------_matching_multiple-line_text--------------------------\n"; 91 my $lines = join '', <FILE>;
89 open FILE, "< file_4_ex_ch7.txt" 90 or die "cannot open file: $!"; ...