npm install rollup-plugin-sass-variables -D
// or
yarn add rollup-plugin-sass-variables --dev
Call the pluglin inside plugins
array
import scssVariable from 'rollup-plugin-sass-variables'
export default {
...
plugings: [
...
scssVariable()
]
}
Import .scss
or .sass
file like any of the following
import variables from 'variables!../../styles/colors.scss'
import variables from 'sass-variable-loader!../../styles/colors.scss'
import variables from '!!sass-variable-loader!../../styles/colors.scss'
import variables from '!!sass-variable-loader?preserveVariableNames!../../styles/colors.scss'