question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular CLI 6.0.0 support for stylePreprocessorOptions

See original GitHub issue

Versions

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 6.0.0-rc.6
Node: 8.9.1
OS: darwin x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.5.8
@angular-devkit/build-angular     0.5.8
@angular-devkit/build-optimizer   0.5.8
@angular-devkit/core              0.5.8
@angular-devkit/schematics        0.5.8
@angular/cdk                      5.2.4
@angular/cli                      6.0.0-rc.6
@angular/flex-layout              5.0.0-beta.14
@angular/material                 5.2.4
@ngtools/json-schema              1.1.0
@ngtools/webpack                  6.0.0-rc.6
@schematics/angular               0.5.8
@schematics/update                0.5.8
rxjs                              5.5.10
typescript                        2.6.2
webpack                           4.6.0

Repro steps

  • Clone this.
  • Old .angular_cli.json
...
      "scripts": [
        ....
      ],
      "stylePreprocessorOptions": { <---- !!!!!!
        "includePaths": [
          "../src/styles/"
        ]
      },
      "environmentSource": "environments/environment.ts",
...
  • Update CLI to 6.0.0-rc.6. Run ng update and then ng update @angular/cli --migrate-only --from=1
  • Run npm start

Observed behavior

ERROR in Module build failed: 
@import "mixins";
^
      File to import not found or unreadable: mixins.

Desired behavior

Support for stylePreprocessorOptions or fix ng update because it removes that part from angular.json file.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

31reactions
lehoffmacommented, Apr 26, 2018

stylePreprocessorOptions is still supported. You will have to manually update the newly generated angular.json though. Its new place is inside the “options” block of the json. An example config could look like this:

"options": {
	"outputPath": "../webapp",
	"index": "src/index.html",
	"main": "src/main.ts",
	"tsConfig": "src/tsconfig.app.json",
	"polyfills": "src/polyfills.ts",
	"assets": [
		{
			"glob": "**/*",
			"input": "src/resources",
			"output": "/resources"
		},
	],
	"styles": [
		"src/styles.scss"
	],
	"stylePreprocessorOptions": {
		"includePaths": [
			"src/styles"
		]
	},
	"scripts": []
}

Note the changed path.

I agree that it would be nice if ng update did this automatically.

12reactions
hudsontavarescommented, May 6, 2018

One thing I found by myself and that can prevent a lot of headache:

For tests running, you must include the same stylePreprocessorOptions from projects.yourProjectName.architect.build.options into projects.YourProjectName.test.options, otherwise the same error will appear.

I was wondering whether it is a bug or the expected behaviour there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support for angular-cli setting "stylePreprocessorOptions ...
What steps will reproduce the problem? 1. Add an includePath to .angular-cli.json > "apps" > "stylePreprocessorOptions" > "includePaths"
Read more >
Angular workspace configuration
Angular CLI supports CSS imports and all major CSS preprocessors: sass/scss and less. See more in the Styles and scripts configuration section.
Read more >
@angular/cli - npm
CLI tool for Angular. Latest version: 15.0.4, last published: 2 days ago. Start using @angular/cli in your project by running `npm i ...
Read more >
6 Best Practices & Pro Tips when using Angular CLI
Best practices for architecture with Core, Shared and lazy-loaded Feature modules · Using aliases for app and environments folders to support cleaner imports ......
Read more >
Generating an app with Angular CLI and preparing i...
Create a new Angular application; Run a development server with LiveReload support to preview your application during development; Add features ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found