How to share assets to multiple apps/libraries in Nx
- Published on
- Dale Larroder--1 min read
Sharing assets in your Nx Workspace
Step 1: Create your shared asset libary
nx g @nrwl/workspace:lib assets
Step 2: Tell you workspace where your assets will come from
In your project.json you can add the following:
"assets": [
"apps/field-app/src/favicon.ico",
{
"glob": "**/*",
"input": "./libs/assets/css",
"output": "./"
},
{
"glob": "**/*",
"input": "./libs/assets/fonts",
"output": "./fonts"
},
{
"glob": "**/*",
"input": "./libs/assets/images",
"output": "./images"
}
],
Resources
Previous Blog← How to merge a git repository into Nx
Next BlogWhy does React need keys? →