0

When I run

npx ng build @mls-ops/tests

I have an error:

Building Angular Package

× Compiling with Angular sources in Ivy partial compilation mode. Can't find stylesheet to import. ╷ 1 │ @import 'node_modules/@mls-ops/bootstrap/style/_variables.scss'; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ projects\mls-ops\tests\src\lib\components\layout\table\table.component.scss 1:9 root stylesheet

Process finished with exit code 1

My library package.json

{
  "name": "@mls-ops/bootstrap",
  "version": "15.0.0",
  "peerDependencies": {
    "@angular/common": "^15.0.0",
    "@angular/core": "^15.0.0",
  },
  "dependencies": {
    "tslib": "^2.3.0"
  },
}

ng-package.json

{
  "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
  "dest": "../../../dist/mls-ops/bootstrap",
  "assets": [
    "/fonts/",
    "/images/",
    "/style/",
    "LICENSE",
    "README.md"
  ],
  "lib": {
    "entryFile": "src/index.ts"
  }
}

I have added it to my library package.json but it doesn't fix the issue.

 "exports": {
    "./variables": {
      "sass": "./style/_variables.scss"
    }
  }

Before angular migration to v15 it worked fine, help me to fix this import issue

2
  • What version of angular did you upgrade from? Shouldn't make a difference but more information rarely hurts. Commented Sep 6, 2023 at 0:28
  • 1
    Upgrade was from v14 to v15 Commented Sep 6, 2023 at 1:08

1 Answer 1

0

Import bootstrap files like this @import 'bootstrap/scss/bootstrap'; This will import bootstrap.scss file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.