esmon
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

💛 You can help the author become a full-time open-source maintainer by sponsoring him on GitHub.


esmon

npm version

Install

npm i -D esmon

Usage

Run a script and watch for changes: (for development)

esmon your-script.ts

This will also watch all the files imported by your-script.ts and re-run it on changes.

Note that this command will emit temporary files to ./temp folder, it's recommended to add it to your .gitignore file.

If you intend to run the file without watching files, you can use the run command instead: esmon run your-script.ts.

Build a script: (for production)

esmon build your-scripts.ts

This command will emit bundled script in esm format to ./dist folder with a filename matching the original filename. i.e. here you will get ./dist/your-script.cjs.

ESM

You can also output ESM format with flag --esm, the output extension will be .mjs. __dirname and __filename will also be shimmed.

Externals

dependencies, devDependencies and peerDependencies are automatically excluded from the bundled scripts. If you wish to bundle devDependencies, you can pass the --bundleDevDeps flag.

Decorators

Both experimentalDecorators and emitDecoratorMetadata options in tsconfig.json are supported, when you have emitDecoratorMetadata enabled we will use swc to transform decorators.

License

MIT © EGOIST

Readme

Keywords

none

Package Sidebar

Install

npm i esmon

Weekly Downloads

32

Version

2.0.1

License

MIT

Unpacked Size

36 kB

Total Files

7

Last publish

Collaborators

  • egoist