-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allow ESM preset to be used in monorepo structure #942
Conversation
Can you please add an example repo to the |
@ahnpnl does the example mean monorepo workspace, right? Is the name |
Yes a monorepo project, that name LGTM |
@@ -0,0 +1,27 @@ | |||
# ExampleAppV12Monorepo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you please copy the README
from example-app-v12
?
"@angular-devkit/build-angular": "~12.0.2", | ||
"@angular/cli": "~12.0.2", | ||
"@angular/compiler-cli": "~12.0.2", | ||
"@types/jasmine": "~3.6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dep should be removed
"compilerOptions": { | ||
"outDir": "../../out-tsc/spec", | ||
"types": [ | ||
"jasmine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be jest
] | ||
}, | ||
"files": [ | ||
"src/test.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed
lint needs fixing with |
"build": "ng build", | ||
"watch": "ng build --watch --configuration development", | ||
"test": "jest -c=projects/app1/jest.config.js", | ||
"test-esm": "NODE_OPTIONS=--experimental-vm-modules jest -c=projects/app1/jest-esm.config.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sadly Windows is not happy with NODE_OPTIONS
, this option seems to work only with Linux/Mac
Thank you for your repeatedly kindly reviews. |
thanks! |
Summary
Because
<rootDir>
is not workspace-root directory when it has a monorepo structure like Nrwl/Nx,<rootDir>/node_modules
is not compatible with that.Test plan
Does this PR introduce a breaking change?
If the workspace is not monorepo and
jest.config.js
is placed at the root directory, the result is not changed. This should help issues at monorepo.Other information