angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

css import inside stylesheet with '~' not working

Open EddyNll opened this issue 9 years ago • 6 comments

Bug Report or Feature Request (mark with an x)

- [ x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli 1.4.0 Node v7.10.0 Windows 10

Repro steps.

  • Upgraded from 1.1.0 to 1.4.0

import stylesheet from node_modules inside styles.less:

@import "~@mystyling/styling/styles.less";

This used to work in 1.1.0.

Mention any other details that might be useful.

Seems like an issue with webpack.

EddyNll avatar Sep 08 '17 09:09 EddyNll

works for me for scss. try this

 @import "~@mystyling/styling/styles";

cedvdb avatar Sep 10 '17 19:09 cedvdb

Same issue here with importing less files from bootstrap module.

@import '~bootstrap/less/responsive-utilities.less';

Only updated angular-cli to 1.4.2.

'~bootstrap/less/responsive-utilities.less' wasn't found. Tried -<absolute-Path-to-working-directory>/src/~bootstrap/less/responsive-utilities.less.

It seems as the "~" is not resolved as a node-module but as part of the folder name. With or without ".less" does not make any difference.

endoodev1 avatar Sep 15 '17 12:09 endoodev1

Having the same issue. Was all working fine until updated to version 1.4.2.

kevfuzz avatar Sep 18 '17 19:09 kevfuzz

I have a project where this was actually working in the CLI version 1.7.4, but upon updating to 6.0.1 I get the error @endoodev1 is getting:

@import "~bootstrap-less/bootstrap/bootstrap.less";
^
'~bootstrap-less/bootstrap/bootstrap.less' wasn't found.

The thing that I see that may be significant, is the path that goes into the node_modules has the ~ before the bootstrap-less folder name:

<absolute url into project>\node_modules\~bootstrap-less\bootstrap\bootstrap.less

vandermore avatar May 16 '18 23:05 vandermore

I'm closing this one as outdated but for the 6.x problem we are tracking it in https://github.com/angular/angular-cli/issues/10913

filipesilva avatar May 21 '18 11:05 filipesilva

This 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.