RapidBundle
Installation
npm i -D rapidbundle
# or with yarn
yarn add -D rapidbundle
Usage
npx rapidbundle
# or with yarn
yarn rapidbundle
GitHub Action
-
Creates a single file bundle for each entry
-
Scans
action.yml
to obtain build info- Infers entries from the
.runs.main
,.runs.pre
and.runs.post
fields - Infers target Node version from the
.runs.using
field
- Infers entries from the
Constraints:
- Entry file should be located in the
src
directory. - Output files should be located in the
dist
directory.
This allows us to properly infer entry point name from the action.yml
.
For example, if you have action.yml
like that:
runs:
using: "node12"
pre: "./dist/setup.js"
main: "./dist/index.js"
post: "./dist/cleanup.js"
It will produce 3 output files in dist
directory and look for the same file
paths in src
directory
ββ src
β ββ setup.ts
β ββ index.ts
β ββ cleanup.ts
ββ dist
β ββ setup.js
β ββ index.js
β ββ cleanup.js
ββ action.yml
Node Package
-
Creates a single file bundle for each entry
-
Scans
package.json
to obtain build info- Infers entries from the
.bin
,.main
,.module
and.types
fields - Infers target Node version from the
.engines.node
field
- Infers entries from the
Constraints:
- Entry file should be located in the
src
directory. - Output files should be located in the
dist
directory.
This allows us to properly infer entry point names from the package.json
.
For example, if you have package.json
like that:
{
"bin": "./dist/cli.js",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts"
}
It will produce 3 output files in dist
directory.
ββ src
β ββ cli.ts
β ββ index.ts
ββ dist
β ββ cli.js
β ββ index.js
β ββ index.cjs
β ββ types.d.ts
ββ action.yml
Limitations
File names should not have multiple .
signs in it:
-
dist/mod.js
will be mapped tosrc/mod
and extension will be resolved automatically -
dist/mod.es.js
will be mapped tosrc/mod.es
and will use.es
extension