[BUG] ng-packagr cannot load a less file from a component less file
See original GitHub issueType of Issue
[X ] Bug Report
[ ] Feature Request
Description
Importing a less or a CSS file contained in node_modules from a component cause a building error indicating “resource is missing”
BUILD ERROR
Ignoring local @import of "../../node_modules/sg-bootstrap/less/themes/standard/colors.less" as resource is missing
How To Reproduce
- Create a component with a less style file
- Import a less or css file provided in the node_modules folder
- Try to package the application
Expected Behaviour
A succesful build
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 2.4.2
@angular/*: 5.2.9
typescript: 2.5.3
node: 8.9.1
npm: 5.6.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:12 (3 by maintainers)
Top Results From Across the Web
angular - Import a external less file into an app.component ...
Everything compiles fine, I just get an error for that variable in the inspector. Invalid Property Value. Here are my less-loaders: module: { ......
Read more >The Best Way To Architect Your Angular Libraries
The ideas presented in this article are based on extensive experience from large enterprise environment (100 Angular SPAs and 30+ libs )…
Read more >ng-packagr - npm
Let's walk through a getting started that'll build an Angular library from TypeScript sources and create a distribution-ready npm package: ...
Read more >Angular compiler options
The configuration options from the base file are loaded first, ... the compiler does not look at the TypeScript version and does not...
Read more >Building an Angular Library with multiple entry points | Articles
The file contains the public API of the library. ... your module and you should not export spec files. ng-packagr will throw an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you are using angular-cli ,
@import '~filepond/dist/filepond.css';
works forng serve
without any modification Then problem is we cannot package using ng-packagrWe had a similar issue. We fixed it. Posting in case this could help your case.
We had an import from bootstrap that is an node module. We had @import “~bootstrap/scss/mixins”; This caused an error when trying to package using ng-packgr In bootstrap, mixins is a folder AND a file (the file has a underscore _mixins.scss) By specifying the underscore, this solved our issue : @import “~bootstrap/scss/_mixins”;