@问题目录
1. webpack.config.js文件的位置
2. Failed to load resource:net::ERR_FLlE_NOT_FOUND
3. UnhandledPromiseRejectionWarning:TypeError:this.getResolve is not a function
4. webpack配置vue:You are using the runtime-only build of Vue where the template compiler is not available.Either pre-compile the templates into render functions,or use the compiler-included build…
解决
1、webpack.config.js文件需放在项目的根目录下。
2、webpack打包没有出错,但是加载页面的时候出现了资源无法加载,那么检查index.html文件的script引入js文件的目录有没有错,如果确定无错,那么删除,再重新把文件路径往上一级目录带一下
我的js文件引入一开始是下面那一条,确认路径无错,但页面报错,后来改为上面那一句,运行成功,再次把路径换回下面这一句,运行正确。
3、这个问题是版本问题,loader的版本和webpack版本不在同一个级别上,在我这里的是css-loader的版本太高了,所以手动降低css-loader版本
4、理解两个概念
- runtime-only =>在代码中,不可以有任何的template
- runtime-compiler =>在代码中,可以有template,因为有compiler可以用于编译template