From edaa91d05e753e3609c00068f565b88c4ef77e62 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sun, 10 Dec 2017 11:37:32 +0100 Subject: Compile scss to css --- webpack.config.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index 482f8db..6db6543 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ const path = require('path'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); -module.exports = { +const js = { entry: './src/client/react/index.jsx', output: { path: path.resolve(__dirname, 'src/client/static'), @@ -18,5 +19,27 @@ module.exports = { }, resolve: { extensions: ['.js', '.jsx'], - } + }, +}; + +const style = { + entry: './src/client/style/index.scss', + output: { + path: path.resolve(__dirname, 'src/client/static'), + filename: 'bundle.css', + }, + module: { + rules: [ + { + test: [/\.scss$/], + exclude: [/node_modules/], + loader: ExtractTextPlugin.extract(['css-loader', 'sass-loader']), + }, + ], + }, + plugins: [ + new ExtractTextPlugin('bundle.css'), + ], }; + +module.exports = [js, style]; -- cgit v1.1