项目环境搭建:1•安装node(node-v查看node版本)2
全局安装vue-cliNpminstall-gvue-cliVue:查看是否安装成功Vuelist:查看可用的模板3•创建一个基于"webpack"模板的新项目Vueinitwebpackproject-name(默认安装2
0版本)Vueinitwebpack#1
0project-name(安装1
0版本)脚手架工具如下:▼vegetarian-node_modules为依赖的模块-src放置组件和入口文件-static放置静态资源文件-index
html文件入口webpack中的一些解释newHtmlWebpackPlugin这个插件的作用是把output输出的文件自动插入到html里1
cdproject-name2
Npminstall3
Npmrundev4
在浏览器输入localhost:8080效果如下:Welbgetabetterunderstardocumentation
Itisalsorecomloader
Ifyouhaveanyissues\\oumayalsowanttocheckout因为使用了语法,安装完后依然报错,是因为会报错,所以还需手动安装
问题一:安装stylus-loader遇到的问题:WARNEtylus—loader@2・3
1requiresapeerof1
3ChunkNamesappChunks0findmodule'stvlusJrunTopLevelLifecyclesnpmrunTopLevelLifecyclesC:\myProjectg'vegetarian>npiiirundev>vegetarian®1
0devC:\myProjecetarian>nodebuild/dev-server・isListellingathttp:/