-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Rollup plugin enhancement #8575
Comments
I'm using fully specified ESM import paths. It seem to be supported by swc/spack - but not configured for rollups' commonjs & node-resolve plugins. Idk. "build": {
"executor": "@nrwl/web:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/my-lib",
"tsConfig": "libs/my-lib/tsconfig.lib.json",
"project": "libs/my-lib/package.json",
"entryFile": "libs/my-lib/src/index.ts",
"external": ["react/jsx-runtime"],
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
"compiler": "swc"
}
}, // index.ts
import { abort } from './two.js';
// two.ts
export function two() {}; [!] Error: unfinished hook action(s) on exit:
(commonjs) resolveId "./two.js" "/home/vadistic/work/my-project/libs/my-lib/src/index.ts"
(node-resolve) resolveId "./two.js" "/home/vadistic/work/my-project/libs/my-lib/src/index.ts" |
There is issue when you try import other libray files to app that use @nrwl/web:rollup (babel) as executor. Ex. // apps/bundler-js/src/main.ts
The error will be shown as
The rootDir is set by entryFile folder.
You can see the source code below. nx/packages/web/src/executors/rollup/lib/normalize.ts Lines 14 to 20 in a622ee5
To fix this problem, the entryRoot has to be root folder by default. The workaround is to move main.ts to root project. and configure project.json and fix entryFile as below.
|
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Description
There is now room for a number of enhancements to the rollup plugin, including but not limited to:
rollupConfig
(Rollup configuration does not support es6 imports #8459 )rollupConfig
configuration export (currentConfig
andoptions
)..ts
forrollupConfig
, with corresponding typing support(type RollupConfigFactory = (...) => ValidateRollupConfig
), for.js
file we can also use JSDoc to provide typing tips from IDE(just as how snowpack does), like/** @type {import("@nrwl/web").RollupConfigFactory } */
.nx g @nrwl/web:rollup exist-web-app --rollupConfig=rollup.config.ts
to add a section of target configuration using@nrwl/web:rollup
as build executor.Motivation
Suggested Implementation
Alternate Implementations
The text was updated successfully, but these errors were encountered: