esm-package-utils

Small package to help building ESM NPM packages.

View on GitHub

Introduction

%s%s

Small package to help building ESM NPM packages.

https://sw.cowtech.it/esm-package-utils

Usage

After your files have been compiled, let's say in dist/mjs folder, you can run the following (or include in package.json scripts):

renamer --find js --replace mjs dist/mjs/* && jscodeshift -s --extensions=mjs -t node_modules/@cowtech/esm-package-utils dist/mjs/**

This command will rename any file to .mjs extension and will make sure that any local import ... from or export ... from has .mjs or index.mjs at the end of the path.

Contributing to @cowtech/esm-package-utils

Copyright

Copyright (C) 2021 and above Shogun shogun@cowtech.it.

Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/isc.

Your browser is obsolete. For the best browsing experience, update it for free by visiting BrowseHappy.
There is a shiny new version. Update now!
Made by a proud Italian!