Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dist/cjs/internals.js';
1 change: 1 addition & 0 deletions internals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./dist/cjs/internals');
20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
}
},
"./internals": {
"types": "./dist/esm/internals.d.ts",
"import": "./src/internals.js"
"import": {
"types": "./dist/esm/internals.d.ts",
"default": "./dist/esm/internals.js"
},
"require": {
"types": "./dist/cjs/internals.d.ts",
"default": "./dist/cjs/internals.js"
}
}
},
"browser": "./dist/regex.min.js",
Expand All @@ -27,18 +33,22 @@
"scripts": {
"bundle:global": "esbuild src/regex.js --global-name=Regex --bundle --minify --sourcemap --outfile=dist/regex.min.js",
"bundle:esm": "esbuild src/regex.js --format=esm --bundle --sourcemap --outfile=dist/esm/regex.js",
"bundle:esm:internals": "esbuild src/regex.js --format=esm --bundle --sourcemap --outfile=dist/esm/internals.js",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this point to src/regex.js -- was that intentional?

"bundle:cjs": "esbuild src/regex.js --format=cjs --bundle --sourcemap --outfile=dist/cjs/regex.js",
"bundle:cjs:internals": "esbuild src/internals.js --format=cjs --bundle --sourcemap --outfile=dist/cjs/internals.js",
"types": "tsc src/regex.js src/internals.js --rootDir src --declaration --allowJs --emitDeclarationOnly --outDir types",
"prebuild": "rm -rf dist/* types/*",
"build": "pnpm run bundle:global && pnpm run bundle:esm && pnpm run bundle:cjs && pnpm run types",
"build": "pnpm run bundle:global && pnpm run bundle:esm && pnpm run bundle:cjs && pnpm run bundle:esm:internals && pnpm run bundle:cjs:internals && pnpm run types",
"postbuild": "node scripts/postbuild.js",
"pretest": "pnpm run build",
"test": "jasmine && tsc --project spec/types/tsconfig.test.json && attw --pack . --entrypoints .",
"test": "jasmine && tsc --project spec/types/tsconfig.test.json && attw --pack . --entrypoints . internals",
"prepublishOnly": "pnpm test"
},
"files": [
"dist",
"src"
"src",
"internals.d.ts",
"internals.js"
],
"repository": {
"type": "git",
Expand Down