-
Notifications
You must be signed in to change notification settings - Fork 12k
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
feat(@angular-devkit/build-angular): allow customization of output locations #26675
Conversation
63f6d96
to
a7ec2e5
Compare
Should there be a check that |
a7ec2e5
to
dc06912
Compare
@JoostK, good call out! Updated. |
7848eff
to
2b47a8c
Compare
packages/angular_devkit/build_angular/src/builders/application/schema.json
Outdated
Show resolved
Hide resolved
packages/angular_devkit/build_angular/src/builders/application/build-action.ts
Outdated
Show resolved
Hide resolved
2b47a8c
to
26c7b08
Compare
26c7b08
to
cf608dd
Compare
…cations This update introduces the ability for users to define the locations for storing `media`, `browser`, and `server` files. You can achieve this by utilizing the extended `outputPath` option. ```json { "projects": { "my-app": { "architect": { "build": { "builder": "@angular-devkit/build-angular:application", "options": { "outputPath": { "base": "dist/my-app", "browser": "", "server": "node-server", "media": "resources" } } } } } } } ``` While not recommended, choosing to set the `browser` option empty will result in files being output directly under the specified `base` path. It's important to note that this action will generate certain files like `stats.json` and `prerendered-routes.json` that aren't intended for deployment in this directory. **Validation rules:** - `browser` and `server` are relative to the configuration set in the `base` option. - When SSR is enabled, `browser` cannot be set to an empty string, and cannot be the same as `server`. - `media` is relative to the value specified in the `browser` option. - `media` cannot be set to an empty string. - `browser`, `media`, or `server` cannot contain slashes. Closes: angular#26632 and closes: angular#26057
cf608dd
to
7060f0f
Compare
Why “media” can not be an empty string? I just want the “assets” folder to be copied into the “assets” folder, what is so wrong with that? It was working for 16 versions and now it is wrong? |
@e-oz,
|
@alan-agius4 that might be true until we reference files from Anyway, thank you for implementing this, it is much better now ❤️ |
Referencing assets in CSS will result in duplicate emissions — one in the designated assets directory and another in media or the root, with the webpack-based builder. For proper processing by the build system relative referenced resources in CSS, it's advisable not to store these assets directly in the "assets" directory. Consider reorganising their placement to avoid such duplication. A good rule of thumb is that if a file is referenced relatively in a CSS is not to placed it in assets directory. |
…on schematics to work with new `outputPath` In angular#26675 we introduced a long-form variant of `outputPath`, this commit updates the application builder migration and ssr schematics to handle this change.
…on schematics to work with new `outputPath` In angular#26675 we introduced a long-form variant of `outputPath`, this commit updates the application builder migration and ssr schematics to handle this change.
…on schematics to work with new `outputPath` In angular#26675 we introduced a long-form variant of `outputPath`, this commit updates the application builder migration and ssr schematics to handle this change.
…on schematics to work with new `outputPath` In angular#26675 we introduced a long-form variant of `outputPath`, this commit updates the application builder migration and ssr schematics to handle this change.
…on schematics to work with new `outputPath` In #26675 we introduced a long-form variant of `outputPath`, this commit updates the application builder migration and ssr schematics to handle this change.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This update introduces the ability for users to define the locations for storing
media
,browser
, andserver
files.You can achieve this by utilizing the extended
outputPath
option.While not recommended, choosing to set the
browser
option empty will result in files being output directly under the specifiedbase
path. It's important to note that this action will generate certain files likestats.json
andprerendered-routes.json
that aren't intended for deployment in this directory.Validation rules:
browser
andserver
are relative to the configuration set in thebase
option.browser
cannot be set to an empty string, and cannot be the same asserver
.media
is relative to the value specified in thebrowser
option.media
cannot be set to an empty string.browser
,media
, orserver
cannot contain slashes.Closes: #26632 and closes: #26057