node安装vue-cli,配置vue开发环境和web
下载node
全局安装cnpm和webpack
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install webpack -g
第一个项目结构
index.html
使用构建后的js文件
testhello webpack
one.js
导出模块
function one() {
console.log("one,一")
}
module.exports = one;
在main中 使用
先导入,在使用
import one from "./one"
import two from "./two"
import three from "./three"
one()
two()
three()
构建
webpack main.js main.bundle.js