-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Support using --module and --outDir flags in conjunction with --build #26763
Comments
My understanding is that these flags should be set by each referenced projects (in tsconfig). Think about a build that brings in more than one modules and it does not make sense to have a (global) CLI option. |
For an example setup, you'll need to look at the Aurelia Monorepo. We have a number of packages that we have to build with a single command, all of which need to output every format. Each package has the same configuration, but we now have to duplicate tons of tsconfig.files all over the place, 6 * NumberOfPackages. In our case, that's 36+ tsconfig files instead of 6. Each time we add a new package to our monorepo, we have to add 6 more copies. It's not good for maintenance in real-world monorepo setups. |
In the case of multiple module outputs per package, there is no functional difference between setting this in the tsconfig versus setting it in a cli flag. Example setupConsider the scenario with two packages
Build stepsNow we run
Then we run
Result
In a next sequential step we build A consumer who needs the non-default module output would typically have the installation/configuration going through our cli which can make sure all packages are referencing the same module output. The identical effect could by achieved by passing the cli arguments to |
Related to #25613 |
@RyanCavanaugh I would be OK with closing this as a duplicate of #25613 if that makes things easier for you guys. Essentially my issue boils down to the same thing, it's just specific to some particular flags. Up to you |
@fkleuver thanks - I think these deserve separate issues since the "mixing" mode would probably naturally exclude per-project-computed things like outdir and rootdir. This scenario is complex enough to warrant its own behavior |
Just a side note because I have the same problem:
Now when I run |
Search Terms
--build --module --outDir
Suggestion
I would like to be able to pass
--module
and--outDir
, in--build
mode so that I can have multiple npm scripts for different build outputs without needing multiple tsconfig files.Use Cases
In Aurelia vNext we've fully adopted the new 3.0 build system and are starting to prepare for publishing. We want to publish the build outputs for all different module systems (for all packages) so that consumers can easily point to the one that's compatible with their project.
We have been able to do this pre-3.0 like so:
Now when trying to do this, it doesn't work:
Results in:
And nothing else happening. I read in the docs that only 4 particular flags are supported in conjunction with
--build
so it seems this is simply not implemented.Examples
We'd like to have something like this in the packages package.json:
And when calling
npm run build
from the top-level package (using lerna...), that would produce build outputs in all module formats for all packagesChecklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: