1.1.3 • Published 9 months ago
pack-module v1.1.3
将mjs的库打包
*重要
1、打包时候node版本要对应
2、使用--experimental-vm-modules模式
> node --experimental-vm-modules index.mjs
结构
root ┬ lib1 ┬ index.mjs
│ ├ data.json
│ └ ...
├ index.mjs // 编译后生成
└ ...
实例1
> npm i pack-module -g
> mdu index -- 缺省 mdu [入口mjs] [目标mjs,可缺省]
实例2
import {build, importFile} from 'pack-module'
build('lib1', 'index') // 打包
import {} from './lib1/index.mjs' // 开发模式
import {} from './index.mjs' // 生产模式,打包后
支持开发代码
let env = 'prod'
// IF DEV
env = 'dev'
// END DEV
console.log(env) // 开发模式:prod;生产模式(打包后):prod
1.1.3
9 months ago
1.1.1
9 months ago
1.1.0
9 months ago
1.1.2
9 months ago
0.9.13
2 years ago
0.9.14
2 years ago
0.9.15
2 years ago
0.9.10
2 years ago
0.9.11
2 years ago
0.9.16
2 years ago
0.9.9
2 years ago
0.9.8
3 years ago
0.9.7
3 years ago
0.9.6
3 years ago
0.9.5
3 years ago
0.9.4
3 years ago
0.9.3
3 years ago
0.9.2
3 years ago
0.9.1
3 years ago
0.9.0
3 years ago