trekhleb / angular-library-seed

🌾 Seed project for Angular libraries that are AOT/JIT compatible and that use external SCSS-styles and HTML-templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I include assets like images in library, and use them for img src ?

MarketingLimited opened this issue · comments

How can I include assets like images in library, and use them for img src ?

You need to copy the assets folder to the dist folder for that you can try this out. This is how i did it and achieved the desired.
npm install copy-webpack-plugin

In your webpack-umd.config.ts file make below changes:-

import * as CopyWebpackPlugin from 'copy-webpack-plugin';

add below to your plugins

plugins: [
new CopyWebpackPlugin([
      { from: './src/assets', to: './assets' },
    ])
]