diff options
Diffstat (limited to 'webpack.config.js')
| -rw-r--r-- | webpack.config.js | 48 | 
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];  | 
