Clean-css error while building an app: Broken @imports with relative paths #712
Comments
Ok, while i were working on the problem, i noticed, that i'd been using outdated app-scripts version 0.47. Therefore i'd updated it to current 1.0.0 version. Another mistake is that i was trying to configurate clean-css as 4.x version, but in latest version of app scripts the version of this module is 3.x. Also i figured out that i was using wrong configuration structure. Finally, i've gotten some results, after solving all of these mistakes.
but with 'relativeTo' option, i'm still getting an error
What i'm doing wrong? |
Ok. Working on the promlem a bit more time, i figured out, that root for clean-css module is not the project folder. After i used environment variables for paths, the build had succeeded.
Is it able to include this config in app-scripts master project? |
What worked for me:
It's a very big difference in load and run speed(second is better) between: ionic build android and ionic build android --prod |
This will have been working until there is no relative urls inside animate.css |
Yep, there's no other import in animate.css - but I've had the same error when building "--prod", for normal build no such error(not sure why) |
Obviously because clean-css was included only in production build. |
Similar problem: Error: Broken @import declaration of "./../assets/css/glyphicons.css" Adding
to ./node_modules/@ionic/app-scripts/config/cleancss.config.js works for me. |
Hi guys, i have a problem with building an application via ">ionic build android --prod" command. The cause of the problem is clean-css module, which throws an error with relative paths in @import statements.
The @imports were used:
The hierarchy of the www folder:
What i tried to do:
2.1 Make custom config for this module as here https://ionicframework.com/docs/v2/resources/app-scripts/
2.2 Then, in custom config i tried to use "rebaseTo" option:
But it had no effect at all. I tried various combinations, e.g:
main.css:
config:
or
main.css:
config:
The text was updated successfully, but these errors were encountered: