npm i -D rapidbundle
# or with yarn
yarn add -D rapidbundle
npx rapidbundle
# or with yarn
yarn rapidbundle
-
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
- 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
-
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
- 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
File names should not have multiple .
signs in it:
dist/mod.js
will be mapped tosrc/mod
and extension will be resolved automaticallydist/mod.es.js
will be mapped tosrc/mod.es
and will use.es
extension