diff --git a/package.json b/package.json index 4c0ff4072db4d4e6439edb32a88ab5a481a6cc9d..5ae6496c9e4cc553d5581809200dc7e2bd427905 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,9 @@ "babel-preset-stage-2": "^6.24.1", "css-loader": "^0.28.4", "eslint": "^4.4.1", + "node-sass": "^4.5.3", "rimraf": "^2.6.1", + "sass-loader": "^6.0.6", "style-loader": "^0.18.2", "webpack": "^3.5.5", "webpack-node-externals": "^1.6.0" diff --git a/webpack.config.js b/webpack.config.js index 65fa7635c2baf46da2be59c5b3cc5eb8f1b0ba9a..c42f82e39a0a0269d57fef83bbae91b9e9f176b1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,11 @@ const path = require('path') const nodeExternals = require('webpack-node-externals') +const include = [ + path.join(__dirname, 'src'), + /xpub-[^/]+\/src/, +] + module.exports = { entry: './src/index.js', output: { @@ -21,10 +26,7 @@ module.exports = { // ES6 modules { test: /\.js$/, - include: [ - path.join(__dirname, 'src'), - /xpub-[^/]+\/src/, - ], + include, loader: 'babel-loader', options: { presets: [ @@ -39,10 +41,7 @@ module.exports = { // CSS modules { test: /\.local\.css$/, - include: [ - path.join(__dirname, 'src'), - /xpub-[^/]+\/src/, - ], + include, use: [ 'style-loader', { @@ -52,6 +51,23 @@ module.exports = { } } ], + }, + + // SCSS modules + { + test: /\.local\.scss$/, + include, + use: [ + 'style-loader', + { + loader: 'css-loader', + options: { + modules: true, + importLoaders: 1 + } + }, + 'sass-loader' + ], } ] }