webpack

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值