webpack
标签(空格分隔): 模块打包器
导出一个模块 用export
export
一定要有配置文件 固定名字 webpack.cong—
webpack 配置最核心的4个概念
moudule.exports = {
entry: 三种方法: 第一中 相对路i经 './xx.js' //entry 入口的意思
output:
}
npm i -d babel-core 转换JS 的插件
apply;
自动编译 webpack –watch ?
yarn start WINDOW
npm start MACoo
//————————————–
import
- 加载一个模块使用 import;
import {test1, test2 as testTwo} from './test.js';
test1(); //执行test1函数;
test2 as testTwe 将 test2 这个模块 重命名为 testTwe 执行的时候使用新的名字
testTwe();
// 向外输出一个模块,名字是test1这个函数
export function test1(){
console.log(‘test1’);
}
// 指定默认导出模块,export default 只能使用一次
export default function test3(){
console.log(‘test3’);
} // 当使用export default 添加默认
react
npm i axios;
mong