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 on relative paths in @import statements.
The @imports were used:
@import '../assets/fonts/Roboto/css/Roboto.css';
@import '../assets/fonts/RobotoCondensed/css/RobotoCondensed.css';
The hierarchy of the www folder:
\---www
\---assets
| \---fonts
| \---Roboto
| \---css
| Roboto.css
| \---fonts
| ......
| Roboto-Fonts.eot
| ......
\---build
main.js
main.css
....
What i tried to do:
-
Make absolute paths in imports: @import ‘/www/assets/fonts/Roboto/css/Roboto.css’; This works without error at least.
-
Make custom config for this module as here https://ionicframework.com/docs/v2/resources/app-scripts/
Then, in custom config i tried to use “rebaseTo” option:module.exports = {
/**
* sourceFileName: the file name of the src css file
*/
sourceFileName: process.env.IONIC_OUTPUT_CSS_FILE_NAME,/**
* destFileName: the file name for the generated minified file
*/
destFileName: process.env.IONIC_OUTPUT_CSS_FILE_NAME,rebaseTo: “/www/build”
};
But it had no effect at all. I tried various combinations, e.g:
main.css:
@import 'assets/fonts/Roboto/css/Roboto.css';
@import 'assets/fonts/RobotoCondensed/css/RobotoCondensed.css';
config:
rebaseTo: "/www"