linnenschmidt / build-ng-packagr Goto Github PK
View Code? Open in Web Editor NEWAngular Build Architect for ng-packagr with asset handling
License: MIT License
Angular Build Architect for ng-packagr with asset handling
License: MIT License
Basically what I'm asking is will it allow me to pull in SCSS files instead of CSS in the glob that will be rendered like normal SCSS files.
Also does this support configurations as well? or would it be possible to have a custom artitecture like "build-2" for one additonal env.
The reason I'm asking this is because I have a library that I need to use in two different environments, and the only different is that the path to so assets are different in each.
Also thanks for making this!
If either the assets folder or the output option contains subdirctories, the builder crashes with:
(node:16280) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, mkdir '\a\b/'
at Object.mkdirSync (fs.js:768:3)
at pathToFolder.split.reduce ('\node_modules@linnenschmidt\build-ng-packagr\src\build\assets.js:64:32)
at Array.reduce ()
at entries.forEach.entry ('\node_modules@linnenschmidt\build-ng-packagr\src\build\assets.js:61:45)
at Array.forEach ()
at globby.then.entries ('\node_modules@linnenschmidt\build-ng-packagr\src\build\assets.js:57:25)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
(node:16280) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a
promise which was not handled with .catch(). (rejection id: 1)
(node:16280) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
But anyway, thank you for writing this little helper.
We depend on build-ng-packagr and appreciate what you have done.
Please upgrade it for Angular 10.
Our library project is upgraded to Angular 10, and we see these dependency issues related to build-ng-packagr:
npm WARN @linnenschmidt/[email protected] requires a peer of ng-packagr@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular-devkit/[email protected] requires a peer of ng-packagr@^9.0.0-rc.7 but none is installed. You must install peer dependencies yourself.
npm WARN @rollup/[email protected] requires a peer of rollup@^2.22.0 but none is installed. You must install peer dependencies yourself.
Thank you!
I try to active sourcemaps with your builder.
Here my angular.json file
"build": {
"builder": "@linnenschmidt/build-ng-packagr:build",
"options": {
"tsConfig": "projects/core/tsconfig.lib.json",
"project": "projects/core/src/ng-package.json",
"assets": [
{
"glob": "**/*.scss",
"input": "styles",
"output": "styles"
},
{
"glob": "**/*",
"input": "assets",
"output": "assets"
}
]
},
"configurations": {
"production": {},
"dev": {
"sourceMap": true
}
}
}
The build with dev configuration fails with :
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(sourceMap).
Hey,
What path we have to provide of our assets in the library code so that after compilation it finds the assets in dist folder?
For eg -
In my library code, the asset folder is at this location.
And the path of the assets I have provided in the library is with this respect to the asset folder in the library code(inside the src folder).
After compilation of dist, the assets folder will be in the root folder of the library.
So what path should I provide in my original library source code of assets?
I upgraded to Angular 13, and it appears that this package no longer works. I think this has been a great contribution that solves a very important issue for building Angular libraries. Is there any plan to continue to support newer versions of Angular?
First of all: thanks for implementing this builder! It helps me a lot.
Unfortunately I also need the option outputPath of the original angular builder. Is it possible to add this?
Right now I get a schema validation error
Schema validation failed with the following errors: > Data path "" should NOT have additional properties(outputPath).
Hey, first, thanks for this lib !
As you may know Angular 9 is about to be released really soon (RC-10 while speaking).
What comes with this version is typescript 3.7 and it would be really nice to be able to update as soon as possible !
Last time I tried there were issues with some imported module from ng-packagr inside assets.ts
It would be awesome if you could give it a look ! Thanks
When developing with libraries it's common to use ng generate library my-lib
this creates the structure projects/my-lib
in the main project directory. When trying to include an assets folder from one of these libraries I get the following error:
Compilation complete. Watching for file changes...
Copying Assets
(node:13410) UnhandledPromiseRejectionWarning: Error: The ./projects/my-lib/assets asset path must start with the project source root.
However if I use an assets folder that lies within the main project folder's src directory, it works fine. Any way that you could fix this?
Also: Thanks for forking this package from Angular so we can finally have dist folders in library builds!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.