Skip to content

Commit

Permalink
fix(package): update exports
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffijoe committed Oct 7, 2024
1 parent 62ced34 commit 9c8e8c1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ The package includes 4 flavors.
- CommonJS, the good ol' Node format - `lib/awilix.js`
- ES Modules, for use with module bundlers **in Node** - `lib/awilix.module.mjs`
- ES Modules, for use with module bundlers **in the browser** -
`lib/awilix.browser.js`
`lib/awilix.browser.mjs`
- UMD, for dropping it into a script tag - `lib/awilix.umd.js`
The `package.json` includes the proper fields for bundlers like Webpack, Rollup
Expand Down
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"main": "lib/awilix.js",
"module": "lib/awilix.module.mjs",
"jsnext:main": "lib/awilix.module.mjs",
"browser": "lib/awilix.browser.js",
"browser": "lib/awilix.browser.mjs",
"umd:main": "lib/awilix.umd.js",
"react-native": "lib/awilix.browser.js",
"react-native": "lib/awilix.browser.mjs",
"typings": "lib/awilix.d.ts",
"engines": {
"node": ">=16.3.0"
Expand All @@ -16,12 +16,19 @@
".": {
"import": "./lib/awilix.module.mjs",
"types": "./lib/awilix.d.ts",
"workerd": "./lib/awilix.browser.mjs",
"browser": {
"import": "./lib/awilix.browser.mjs",
"default": "./lib/awilix.umd.js"
},
"default": "./lib/awilix.js"
},
"./browser": {
"import": "./lib/awilix.browser.js",
"import": "./lib/awilix.browser.mjs",
"types": "./lib/awilix.d.ts",
"default": "./lib/awilix.browser.js"
"workerd": "./lib/awilix.browser.mjs",
"browser": "./lib/awilix.browser.mjs",
"default": "./lib/awilix.umd.js"
},
"./lib/*.js": {
"types": "./lib/*.d.ts",
Expand All @@ -39,7 +46,7 @@
"cover": "npm run test -- --coverage",
"publish:pre": "npm run lint && npm run build && npm run cover",
"publish:post": "npm publish && git push --follow-tags",
"release:prerelease": "npm run publish:pre && npm version prerelease && npm run publish:post",
"release:prerelease": "npm run publish:pre && npm version prerelease --preid alpha && npm run publish:post",
"release:patch": "npm run publish:pre && npm version patch && npm run publish:post",
"release:minor": "npm run publish:pre && npm version minor && npm run publish:post",
"release:major": "npm run publish:pre && npm version major && npm run publish:post",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default [
output: [
{
name: 'Awilix',
file: 'lib/awilix.browser.js',
file: 'lib/awilix.browser.mjs',
format: 'es',
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/rollup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const cjs = require('../../lib/awilix')
// @ts-ignore
import * as es from '../../lib/awilix.module.mjs'
const umd = require('../../lib/awilix.umd')
const browser = require('../../lib/awilix.browser')
const browser = require('../../lib/awilix.browser.mjs')

describe('rollup artifacts', () => {
it('works', () => {
Expand Down

0 comments on commit 9c8e8c1

Please sign in to comment.