I want to convert some files from *.scss
extension to *.css
one and then copy them to the target folder .
These files aren't a part of a module so I can't import them by the *.scss
loader (i.e import "myStyle.scss"
).
I know how to copy files by the CopyWebpackPlugin plugin -
plugins: [
new CopyWebpackPlugin([
{ from: 'source/myStyle.scss', to: 'myStyle.css' }
])
]
So now all I need is to add it a conversion from scss
to css
before to copying .
How could I achieve that ?
You'll need
sass-loader
for that. For more info, check out https://github.com/webpack-contrib/sass-loaderUpdate: Try something like this.
You can use transform option of CopyWebpackPlugin plugin in conjunction with
node-sass
. I.e. usesass.renderSync
function fromnode-sass
: