Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
0.2.0 (#8)
Browse files Browse the repository at this point in the history
* [Update]: make sure node uses the correct loader

Add exports to package.json and use .cjs and .mjs to make use that node uses the correct loader

BREAKING CHANGE: file now have .cjs and .mjs extensions instead of .js

* [Chore]: bump version to 0.2.0
  • Loading branch information
matteosacchetto committed Oct 6, 2022
1 parent c2e185d commit 6d2dcbb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"name": "@matteosacchetto/typescript-rollup-lib-template",
"version": "0.1.4",
"version": "0.2.0",
"description": "Template for creating a JS library using Typescript and Rollup for bundling it to CJS and ESM modules",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"types": "dist/index.d.ts",
"exports": {
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs",
"types": "./dist/index.d.ts"
},
"sideEffects": false,
"scripts": {
"lint": "npx tsc --noemit && npx eslint src test",
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default [
preferConst: usePreferConst,
preserveModules: usePreserveModules,
strict: useStrict,
entryFileNames: '[name].js',
entryFileNames: '[name].cjs',
sourcemap: useSourceMap,
},
plugins: [
Expand Down Expand Up @@ -92,7 +92,7 @@ export default [
preferConst: usePreferConst,
preserveModules: usePreserveModules,
strict: useStrict,
entryFileNames: '[name].js',
entryFileNames: '[name].mjs',
sourcemap: useSourceMap,
},
plugins: [
Expand Down

0 comments on commit 6d2dcbb

Please sign in to comment.