I would like define global variable or env on webpack.config.js and pass variable to .js or .scss file
I have a define "__basedir" is absolute path
new webpack.DefinePlugin({ __basedir: "'" + __dirname + "'", }),
{
loader: 'sass-loader',
options: {
data: "$basedir: '" + __dirname + "';"
}
}
On js file is already work
require(__basedir + '/public/js/Sortable.min.js');
but on scss file it doesn't work
@import "$__basedir/public/css/include-media/dist/_include-media.scss";
how to fix. Thanks