Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/
Short description of the problem:
I cannot prepend Sass code on build time. I either replace everything using the file option or lose the data option, as seen in sass.ts#L137.
What behavior are you expecting?
I expect the data option to behave as with sass-loader, prepending its content to the actual source Sass code.
Steps to reproduce:
- Create a
sass.config.js locally and configure it in package.json, ionic_sass.
- Export a
data option with static content, such as data: "$primaryBase: #ffffff",
- Use that variable in
variables.scss.
- It will fail on build time, not finding
$primaryBase, as it is ignored.
# sass.config.js
const sassConfig = require('@ionic/app-scripts/config/sass.config.js');
const path = require('path');
require('dotenv-defaults').config({
path: path.join(__dirname, '../.env'),
defaults: path.join(__dirname, '../.env.defaults'),
encoding: 'utf-8',
});
module.exports = {
...sassConfig,
data: `$primaryBase: ${process.env.PRIMARY_BASE};`,
};
# variables.scss
$colors: (
primary: (
base: $primaryBase,
)
);
Which @ionic/app-scripts version are you using?
3.2.3
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)