Search code examples
angularsassangular-library

Use same Styling files (.SCSS) for multiple angular 8 projects


I Have different projects developed in angular 8 and have same styling.

I want to use same SCSS files so that in future changes can be made at one place.

I have tried below but this is not working for me.

Compiling css in new Angular 6 libraries

Please guide to right direction.


Solution

  • For example you can:

    1. Create your npm or yarn package (it can be private) with styles.
    2. Use it as a package.json dependency to a different projects
    3. Profit )

    Useful links:

    https://docs.npmjs.com/creating-and-publishing-private-packages

    https://docs.npmjs.com/creating-and-publishing-an-org-scoped-package

    Other option can be:

    1. create single angular project with one package.json and angular.json
    2. have different project in different folders
    3. have common styles inserted in every project
    4. have different commands in package.json to run different projects (on different ports if you need it to run at the same time)
    5. have different configurations in angular.json for different projects