question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Asset copy Enhancement

See original GitHub issue

Type of Issue

[ ] Bug Report
[x] Feature Request

Description

Recent PR https://github.com/ng-packagr/ng-packagr/pull/1465/ Introduced the feature to copy assets. But the current format will limit us to :

  1. Having all assets under project src … ( from looking at the code)
  2. and we cannot customize the destination folder structure. we are expecting assets to be under :: projects/<lib-name>/**/assets and destination will always be mapped to <dist-path>/<lib-name>/**/assets

in my project , we have multiple projects (libraries & apps)in same repo and we have a common folder for assets … and this is out side of the project root (as expected)

with this i would not be able to use this ng-packagr feature as is …

Expected Behaviour

I was looking at the AsstePattern syntax of anuglar-builder ( browser) … https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_angular/src/browser/schema.json#L393

export type AssetPattern =
  | {
      /**
       * The pattern to match.
       */
      glob: string;
      /**
       * The input directory path in which to apply 'glob'. Defaults to the project root.
       */
      input: string;
      /**
       * An array of globs to ignore.
       */
      ignore?: string[];
      /**
       * Absolute path within the output.
       */
      output: string;
    }
  | string;

this will allow to be more granular and as a user of the ng-packagr i can get alot of flexibility …

I wanted this feature badly for my projects so did a poc for the same ,in the forked repo https://github.com/arvindnama/ng-packagr/commit/957c8f057636d86bf7e1637fa567540bed7a81f3

NOTE: I will create a PR on the master branch with the above changes soon.

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr: 9.0.0-rc3
@angular/*: 8.2.3
typescript: 3.5.3
rxjs: 6.5.3
node:12.13.1
npm 6.12.1

Please include all version numbers that might be relevant, e.g. third-party libraries

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:51
  • Comments:23 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
arvindnamacommented, Jan 7, 2020
10reactions
twopelucommented, Jan 19, 2021

This same issue is happening in our projects, the new feature in ng-package to copy assets is ok but I think it is not compliant with default structure of an Angular library created with Angular CLI, where assets are into src folder not at the same level and they are supposed to be imported from /assets not /src/assets when using them in other applications in angular.json.

The propert solution would be to allow defining the output path so that you can keep the assets folder where it is and copy them to dist/library/assets instead of dist/library/src/assets.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Place Copy asset operation | Adobe Experience Manager
Learn how to use assets from AEM Assets using the Place Copy operation.
Read more >
1586025 - 'Multiple assets' function buttons grey
Function buttons like for example Cut, Copy & Paste are greyed out when using the 'Multiple assets" (F8) option in transactions ABAVN, ABUMN,ABAON,ABNAN....
Read more >
How Useful Is The Copy Enhancement Passive From Mujina ...
The Soul Core gives you a passive ability that has around 50%+ to copy any buffs on any enemy you target.
Read more >
How to derive Depreciation Expense Account from Category ...
How to derive Depreciation Expense Account from Category Defaults for Tax Assets after Periodic Mass Copy? (Doc ID 2635776.1).
Read more >
About the ad level asset report for responsive search ads
You'll be able to evaluate which assets to replace and which assets are most effective to enhance the performance of your ads.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found