0.9.16 • Published 7 months ago

pack-module v0.9.16

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

将mjs的库打包

*重要

1、打包时候node版本要对应

2、使用--experimental-vm-modules模式

> node --experimental-vm-modules index.mjs

结构

root ┬ lib1 ┬ index.mjs
     │      ├ data.json
     │      └ ...
     ├ index.mjs // 编译后生成
     └ ...

实例

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
0.9.13

7 months ago

0.9.14

7 months ago

0.9.15

7 months ago

0.9.10

7 months ago

0.9.11

7 months ago

0.9.16

7 months ago

0.9.9

12 months ago

0.9.8

2 years ago

0.9.7

2 years ago

0.9.6

2 years ago

0.9.5

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.0

2 years ago