generator-angular2-library
generator-angular2-library copied to clipboard
Assets support in library
How we can add assets like images in module so that it will come with the library and when this library used there will no need to copy assets
Two ways that I thought of:
- You can put svg markup into a component's template
- or you can change the outer package.json so that it copies the assets folder to the dist folder like this:
"scripts": { "build": "gulp build && npm run build:copy", "build:copy": "cp -R src/assets dist/assets", "build:watch": "gulp", "lint": "tslint --type-check --project tsconfig.json src/**/*.ts", "test": "tsc && karma start" },
I like and use option 1 so that the svg images are part of my app and don't need a http get. Depends on the nature of the images.