aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-01-29 16:31:05 +0100
committerGitHub <noreply@github.com>2018-01-29 16:31:05 +0100
commit694580bc532239a32c2fbf61d7f09e793fd1cb11 (patch)
treeacd21e2654d6c5e70dc41c675972794ce95b4062 /webpack.config.js
parentf18692872cdc28d29917247ef4f8ef7553a8b023 (diff)
parent9a9edd1865d619caada787231c8bb34be25af3af (diff)
Merge pull request #15 from nloomans/react
Move project over to react
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js48
1 files changed, 39 insertions, 9 deletions
diff --git a/webpack.config.js b/webpack.config.js
index 8b713a6..cf63880 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,19 +1,49 @@
+const webpack = require('webpack');
const path = require('path');
+const ExtractTextPlugin = require('extract-text-webpack-plugin');
-module.exports = {
- entry: './src/client/javascript/main.js',
+const js = {
+ entry: './src/client/react/index.js',
output: {
path: path.resolve(__dirname, 'src/client/static'),
- filename: 'bundle.js'
+ filename: 'bundle.js',
},
module: {
rules: [
{
- test: [/\.js$/],
+ test: [/\.js$/, /\.jsx$/],
exclude: [/node_modules/],
loader: 'babel-loader',
- options: { presets: ['es2015'] }
- }
- ]
- }
-} \ No newline at end of file
+ options: { presets: ['es2015', 'react', 'stage-2'] },
+ },
+ ],
+ },
+ resolve: {
+ extensions: ['.js', '.jsx'],
+ },
+ plugins: [
+ new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /nl/),
+ ],
+};
+
+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];