Help you to build 3 types(UMD, Commonjs, ES Module) of module, support js and ts.
yarn add -D build-my-package
bmp src -l typescript -m umd -w
# help
bmp -h
const { buildUMD, buildES, buildCommonjs } = require('build-my-package')
const path = require('path')
buildUMD({
entry: path.join(__dirname, './src/onEnter.js'),
filename: 'onEnter.js'
})
buildCommonjs({
entry: path.join(__dirname, './src')
})
- absolute path of entry file/dir
- exclude files in entry
- e.g.
['src/**/template/**/*']
- 'es module' | 'commonjs' | 'umd'
- absolute path of output dir
# default outputpath
├── dist # umd module
├── es # es module
├── lib # commonjs module
- default 'production'
- webpack mode
- webpack output.filename
- filename of umd module file
- webpack output.library
- library name of umd module file
- default 'javascript'
- 'typescript' | 'javascript' | undefined
- gulp-typescript settings
- will be used only when
language = 'typescript'
- default false
- webpack watch
- default false
- babel runtime config