-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
featureIssue that requests a new featureIssue that requests a new feature
Description
A library project cannot specify assets to be packaged in the npm package.
Adding an assets entry in the angular.json produces an error:
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/my-lib/tsconfig.lib.json",
"project": "projects/my-lib/ng-package.json",
"assets": [
"projects/my-lib/src/assets"
]
},
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(assets).
Additionally, the json data path is not correctly reported in the error message.
Versions
Angular CLI: 6.0.3
Node: 10.1.0
OS: linux x64
Angular: 6.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.6.3
@angular-devkit/build-angular 0.6.3
@angular-devkit/build-ng-packagr 0.6.3
@angular-devkit/build-optimizer 0.6.3
@angular-devkit/core 0.6.3
@angular-devkit/schematics 0.6.3
@angular/cli 6.0.3
@angular/pwa 0.6.3
@ngtools/json-schema 1.1.0
@ngtools/webpack 6.0.3
@schematics/angular 0.6.3
@schematics/update 0.6.3
ng-packagr 3.0.0-rc.5
rxjs 6.1.0
typescript 2.7.2
webpack 4.8.3
Repro steps
- Create a new angular-cli workspace:
ng new
- Generate a new library project:
ng g library
- Create and put some assets in your library
src/assets
folder - Edit
angular.json
to include the assets, like in the above example. - Build your library with
ng build
.
Observed behavior
The above-mentioned error is thrown.
Desired behavior
The assets should be copied in the dist folder, like the applications, and. packaged in the npm module.
Mention any other details that might be useful (optional)
angular applications are able to import assets from npm modules. angular-cli libraries should be able to pack them in the npm module just like the applications.
Shared components may rely on assets to function properly.
keatkeat87, epelc, doonot, vinagreti, vkilaru and 26 more
Metadata
Metadata
Assignees
Labels
featureIssue that requests a new featureIssue that requests a new feature