vue2+webpack4脚手架搭建
2019-01-28 本文已影响0人
王仁兴
一、参考资料
1. mkdir bestpractice; cd bestpractice
2. yarn init
3. yarn add -D webpack webpack-cli
4. yarn add vue vue-template-compiler vue-loader style-loader css-loader
5. vi package.json 添加如下内容
"scripts": {
"build": "webpack --config webpack.config.js"
}
6. vi webpack.config.js
constpath =require('path')
module.exports = {entry:'./src/main.js',output: {path: path.resolve(__dirname, dist),filename:'index.js'} }