Uh this is new I d swe…

less than 1 minute read

Uh, this is new. I’d swear it wasn’t a issue with v9.2

import { ReactComponent as IconAddUser } from '@myscope/icons/icon-add-user.svg'; results in:

Deep imports into libraries are forbiddeneslint@nrwl/nx/enforce-module-boundaries I need this icon library to be its own package, and I thought I had it sorted with:

"build": { "builder": "@nrwl/node:package", "options": { "outputPath": "dist/libs/icons", "tsConfig": "libs/icons/tsconfig.lib.json", "packageJson": "libs/icons/package.json", "main": "libs/icons/src/index.ts", "assets": ["libs/icons/*.md", "libs/icons/src/lib/*.svg"] } } but today I came check again, and boom

Responses:

This is the tslint or eslint rule that is shipped by nx that does not allow this if you really need it then whitelist those imports

Yup, I did. There’s something amiss tho, since Nx also ships with SVGR && wants you to make a lib of everything :smile:

Updated: