Skip to content

Commit

Permalink
fix: fix package exports
Browse files Browse the repository at this point in the history
  • Loading branch information
okikio committed Oct 15, 2021
1 parent 9cdd271 commit 9ea9f8d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
31 changes: 14 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,20 @@
"type": "module",
"sideEffects": false,
"description": "A small mostly spec. compliant polyfill/ponyfill for SharedWorkers, it acts as a drop in replacement for normal Workers, and supports an API surface that matches normal Workers.",
"main": "src/index.ts",
"publishConfig": {
"umd": "sharedworker",
"access": "public",
"legacy": "lib/index.js",
"main": "lib/index.cjs",
"types": "@types/index.d.ts",
"browser": "lib/index.mjs",
"module": "lib/index.mjs",
"exports": {
".": {
"require": "./lib/index.cjs",
"import": "./lib/index.mjs",
"default": "./lib/index.mjs"
},
"./lib/*": "./lib/*"
}
"umd": "sharedworker",
"access": "public",
"legacy": "lib/index.js",
"main": "lib/index.cjs",
"types": "@types/index.d.ts",
"browser": "lib/index.mjs",
"module": "lib/index.mjs",
"exports": {
".": {
"require": "./lib/index.cjs",
"import": "./lib/index.mjs",
"default": "./lib/index.mjs"
},
"./lib/*": "./lib/*"
},
"directories": {
"lib": "./lib",
Expand Down
10 changes: 5 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ const __dirname = path.dirname(__filename);
import pkg from './package.json';

export default {
input: pkg.main,
input: "src/index.ts",
output: [
{
file: path.join(__dirname, pkg.publishConfig.module),
file: path.join(__dirname, pkg.module),
exports: "named",
format: "es"
},
{
file: path.join(__dirname, pkg.publishConfig.main),
file: path.join(__dirname, pkg.main),
exports: "named",
format: "cjs"
},
{
file: path.join(__dirname, pkg.publishConfig.legacy),
file: path.join(__dirname, pkg.legacy),
exports: "named",
name: pkg.publishConfig.umd,
name: pkg.umd,
format: "umd",
},
],
Expand Down

0 comments on commit 9ea9f8d

Please sign in to comment.