Repository navigation
Passing additional options to node-sass #1791
Description
Activity
I needed to customize webpack-build-development.ts file inside angular-cli so the library could be compiled correctly. Is there any way to do this by configuration in angular cli?
- addedP5The team acknowledges the request but does not plan to address it, it remains open for discussionThe team acknowledges the request but does not plan to address it, it remains open for discussion
on Aug 23, 2016 There is no way to do this right now, but we're getting a few requests for ways to add paths so it's likely to make it in.
Reacted by Thilak Rao, Jose E. Bolaños and Clay vanSchalkwijk@gelidus Great hack. I wanted to do the same, but it doesn't seem to work.
- Changed
webpack-build-development.ts - Rebuilt the angular-cli project and ran
npm link. - Installed
npm install bootstrap-sassas well, as that seems to be the path you referred to here https://www.diffchecker.com/05czn5se
Still getting the same errors for "bootstrap/*". Any suggestions are greatly appreciated.
- Changed
@linktothapast
I've written a workaround that works withangular-cli 1.0.0-beta.15, for1.0.0-beta.11-webpack.2just locate right files and adjust the script.Reacted by Jose E. BolañosClosing this as obsolete. We support this.
Reacted by Peter MalinaFYI for those looking for a temporary workaround on this, I've found one that works with SASS. The SASS compiler uses a
SASS_PATHenv variable, so if you set that then everything seems to work swell. You just need to make sure the env var is set when you run anyngcommands.In my project root directory, I have:
# env.rc export SASS_PATH="`pwd`/src/css"And in my
package.json:{ "scripts": { "start": "source ./env.rc && ng serve" ... } }- added 2 commits that reference this issue
on Jan 13, 2017 2 remaining items
- added 4 commits that reference this issue
on Jan 13, 2017 - added a commit that references this issue
on Jan 19, 2017 - added a commit that references this issue
on Feb 9, 2017 Why limit this to just
includePaths? I want to use the node-sassdataoption (https://github.com/sass/node-sass#data) to automatically include a setup stylesheet for all components:data: '@import \'variables\';'This way, you don't have to include the variables stylesheet in every component stylesheet where you want to use global variables.
Please change
additionalPropertiesto true?. cc @filipesilvaReacted by Frank Spin, David LOIRET and Nitsan BaleliIs this fix (i.e using stylePreprocessorOptions) available for LESS?
Reacted by SixQ@filipesilva i understand :) It's just that having a "setup" stylesheet with SASS variables & mixins and not having to
@importthat everywhere seems like something that adds value for everyone :)Reacted by Boris Berman, Rafael Bitencourt, Matthew Dangerfield, Charlie McKenzie, Rafael Kraut, David LOIRET, ChrisLang, Hetty de Vries, msosa, John Palit and 3 more@filipesilva I'm not quite sure why we can't just pass through any options that preprocessors support, rather than having to "support" them? I can see from the way that you have implemented this option, that it would be unmaintainable to have to set them all up in
webpack-build-styles.ts. However, there is also much demand for thedataoption, see #1253 #3700 and comments on https://netbasal.com/angular-cli-and-global-sass-variables-a1b92d8ca9b7 to mention a few.Since the data property would just be passed through as is, would adding it be a big job?
Reacted by David Mulder, Vers and Alexis Georgesangular-automatic-lock-bot commented
on Sep 8, 2019 More actionsThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
- locked and limited conversation to collaborators
on Sep 8, 2019 - added a commit that references this issue
on May 29, 2026
Versions:
angular-cli: 1.0.0-beta.11-webpack.2
node: 6.2.2
os: linux x64
Is there a way to pass additional options to node-sass with current configuration files? This was previously possible with angular-cli-build.js.
I need to pass include directory of bootstrap-sass for the bootstrap-material-design library, as it is importing "bootstrap/*" files but the library is located inside node_modules.