Angular-cli: Adding support to use PostcssCliResourcesOptions resourceOutputPath option in Angular style build

Created on 28 Nov 2018  路  8Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions


npm 6.4.1,
Angular CLI: 7.0.5
Node: 10.13.0
OS: darwin x64
Angular:
...

Package Version

@angular-devkit/architect 0.10.5
@angular-devkit/core 7.0.5
@angular-devkit/schematics 7.0.5
@schematics/angular 7.0.5
@schematics/update 0.10.5
rxjs 6.3.3
typescript 3.1.6

Repro steps


N/A

The log given by the failure


N/A

Desired functionality


Currently as specified here https://github.com/angular/angular-cli/wiki/build#css-resources,

CSS resources
Resourcesin CSS, such as images and fonts, will be copied over automatically as part of a build. If a resource is less than 10kb it will also be inlined.
You'll see these resources be outputted and fingerprinted at the root of dist/.

For PostcssCliResourcesOptions, there is an optional option resourcesOutputPath,

export interface PostcssCliResourcesOptions {
  baseHref?: string;
  deployUrl?: string;
  resourcesOutputPath?: string;
  filename: string;
  loader: webpack.loader.LoaderContext;
}

however, it is not used for the style(css, scss) build.

It would be great that the resourceOutputPath can be used during the style build, so that user can have those static resources output to the desired directory. It will improve readability and maintainability of the SPA, especially that the SPA is hosted in a third party content management system.

Mention any other details that might be useful

Most helpful comment

Hi, this will be available in 7.2.0 As that鈥檚 the next minor release.

Also, kindly note that the documentation linked is for version 6. The new documentation resides in https://angular.io/cli/build.

All 8 comments

it was implmented here https://github.com/angular/angular-cli/commit/a38566f18e4e9749d51a536f8818c99f3287f48c
When will be this change in official release?

Hi, this will be available in 7.2.0 As that鈥檚 the next minor release.

Also, kindly note that the documentation linked is for version 6. The new documentation resides in https://angular.io/cli/build.

@alan-agius4 thanks, is that about 2 weeks later? :)

Using CLI v 7.2.0-rc.0
Despite the property being in the schema for angular.json

            "outputPath": {
              "type": "string",
              "description": "Path where output will be placed."
            },
            "resourcesOutputPath": {
              "type": "string",
              "description": "The path where style resources will be placed, relative to outputPath."
            },

using it my angular.json

          "options": {
            "outputPath": "dist/webapp",
            "deployUrl": "/",
            "resourcesOutputPath": "resources",

I get the following error

Schema validation failed with the following errors:
  Data path "" should NOT have additional properties(resourcesOutputPath).

Am I misunderstanding the usage?

Using this option still leads to the error as mentioned above

What's the version of @angular-devkit/build-angular are you using? it should be >=0.12.1?

If the problem persists after updating, kindly open a new issue. Thanks.

@alan-agius4 Thanks for the clarification.
After updating to @angular-devkit/build-angular=0.12.1 it works fine.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MateenKadwaikar picture MateenKadwaikar  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

sysmat picture sysmat  路  3Comments

hartjo picture hartjo  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments