This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.
Prepend Sass code on build time #1533
Open
Description
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 inpackage.json
,ionic_sass
. - Export a
data
option with static content, such asdata: "$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)
Metadata
Metadata
Assignees
Labels
No labels