Skip to content

Commit

Permalink
refactor(ng-dev): export non esm bundled code in ng-dev (#2060)
Browse files Browse the repository at this point in the history
In ng-dev instead of exporting the esm bundles when importing from the @angular/ng-dev entrypoint, we instead should export the non bundled code.

When we don't do this, if we try to bundle the imported code again, we get issues with multiple `createRequire` imports.

PR Close #2060
  • Loading branch information
josephperrott committed May 14, 2024
1 parent 05282ca commit 8b11774
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions ng-dev/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pkg_npm(
substitutions = NPM_PACKAGE_SUBSTITUTIONS,
deps = [
":bundles",
":ng-dev",
":types",
],
)
13 changes: 9 additions & 4 deletions ng-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@
"version": "0.0.0-{SCM_HEAD_SHA}",
"type": "module",
"private": true,
"bin": {
"ng-dev": "./bundles/cli.mjs"
},
"bin": "./bundles/cli.mjs",
"exports": {
".": {
"types": "./index.d.ts",
"default": "./bundles/index.mjs"
"default": "./index.js"
},
"./*": {
"types": "./*.d.ts",
"default": "./bundles/*.mjs"
}
},
"dependencies": {
"@octokit/rest": "20.1.0",
"@types/semver": "^7.3.6",
"@types/supports-color": "^8.1.1",
"@yarnpkg/lockfile": "^1.1.0",
"chalk": "^5.0.1",
"semver": "^7.5.4",
"supports-color": "9.4.0",
"typed-graphqlify": "^3.1.1",
"typescript": "~4.9.0"
}
}

0 comments on commit 8b11774

Please sign in to comment.