You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am just getting started with Nx and have an existing lerna based Angular project containing a bunch of packages that get built and published to NPM independently.
In many of these packages, we have custom build scripts that get run like so:
"scripts": {
"build": "node --max_old_space_size=10000 ../../node_modules/@angular/cli/bin/ng build ng-generic-components && npm run bundle-styles",
"bundle-styles": "npm run bundle-style-utilities && npm run bundle-theme && npm run bundle-compatible",
"bundle-theme": "../../node_modules/scss-bundle/dist/bundle-cli.js -c org-theme.bundle-config.json",
"bundle-style-utilities": "../../node_modules/scss-bundle/dist/bundle-cli.js -c utilities.bundle-config.json",
"bundle-compatible": "../../node_modules/scss-bundle/dist/bundle-cli.js -c compatible.bundle-config.json",
As you can see, this is to run a bunch of style preprocessor scripts so we can get some global styles included in our final bundle.
So my question is, how can I get the Nx library builder to run extra steps like the above as part of its packaging?
I have seen section in the Nx docs about custom builders and executors, so I wondered if these may help me, but I am not totally sure.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am just getting started with Nx and have an existing lerna based Angular project containing a bunch of packages that get built and published to NPM independently.
In many of these packages, we have custom build scripts that get run like so:
As you can see, this is to run a bunch of style preprocessor scripts so we can get some global styles included in our final bundle.
So my question is, how can I get the Nx library builder to run extra steps like the above as part of its packaging?
I have seen section in the Nx docs about custom builders and executors, so I wondered if these may help me, but I am not totally sure.
I also came across this answer by @vsavkin
This seems to be the kind of thing I need and so I have attempted it for my library like so:
But when it runs, I see the base-build step completes in my terminal but then I get a permission denied at the scss-bundle step:
Do I need to be doing anything with regards to permissions to this scss-bundle dir, or should this just work?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions