-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to import _.scss partial files into Angular CLI project #2880
Comments
It looks like it is importing properly. The issue is that the file is importing additional files; one of which cannot be found: Granted the error is somewhat cryptic, but in the future, Stack Overflow is probably the proper venue (at least initially) for questions such as this. |
Thanks @clydin - Yeah I've also figured out that Angular CLI does found the files and import them.. just the library that we use need to tweak a bit to get it working. Cheers |
Actually, Angular CLI does not seem to import partials files before the main scss loaded therefore it said Here is what I have included into angular-cli.json file where you can see _colours.scss was already included.
|
The problem is that there is still import statements in There's a WIP PR to allow the configuration of saas/scss include paths which would simplify your setup. But until then you'll need to reconstruct |
Thanks @clydin for pointing that out. I tried to reconstruct
It comes up with a different error message complaining about variable has not been defined which means the _colours.scss has not been included.
I'm stumped ! |
I'm seeing the same problem. My project is not huge and I was trying to import some variables from _variables.scss. In the end i had to delete (not just |
@simonh1000 agree. I ended up coping all scss files into 'scss' folder /app/scss and import them into style.scss file. Not ideal as we have to do it again when a newer version of scss files released. |
Hey guys something new about this ? I am stuck with the import partials problem too. |
Interesting that it will import partials from the node_modules folder, Can we have the angular-cli.json configure the webpack sassLoaders property; in fact, why can't we have custom webpack configs for angular-cli projects? edit If you drop you sass variables into your node_modules folder it will work. [not ideal] but a work around. I suggest allowing a configuration int he angular-cli,json for a sass partials folder(s). |
You can configure include paths for stylesheet preprocessors via |
Closing as we added sass paths support. |
The issue, as reported, doesn't relate to sass paths in the import. The issue is that it cannot resolve a valid path when that relates to a sass partial.
File:
exists at:
This should resolve correctly but it doesn't. Still occurring. Suggest re-opening. |
+1 This is painful. |
+1 Doesn't appear that partials are being loaded correctly. |
Hi, Same issue Here, why is still closed ? |
+1 If I am trying to import css like this @import "/app/assets/css/fonts.css"; and then open in Chrome : F12 / Sources I see the path with name 'app/assets/css' as one literal instead of a set of folders app / assets / css so itis probably the problem with import - it does not put resource in proper place. |
Hey, Y'all I think this issue is still happening. Do we have any solution for it ? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Windows 10 (Win32 x64)
angular-cli: 1.0.0-beta.17
node: 6.9.1
os: win32 x64
Versions.
angular-cli: 1.0.0-beta.17
node: 6.9.1
npm: 3.10.8
Repro steps.
npm install govuk-elements-sass --save
"styles": [ "../node_modules/bootstrap/dist/css/bootstrap.min.css", "../node_modules/govuk-elements-sass/public/sass/_govuk-elements.scss", "styles.scss" ],
The log given by the failure.
ERROR in ./~/css-loader!./~/postcss-loader!./~/sass-loader!./~/govuk-elements-sass/public/sass/_govuk-elements.scss Module build failed: undefined ^ File to import not found or unreadable: colours Parent style sheet: stdin in D:\workspace\dnaapp\node_modules\govuk-elements-sass\public\sass\_govuk-elements.scss (line 6, column 1) @ ./~/govuk-elements-sass/public/sass/_govuk-elements.scss 4:14-147 @ multi styles
Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: