diff options
Diffstat (limited to 'webpack.config.js')
| -rw-r--r-- | webpack.config.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..3185d2c --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,42 @@ +var webpack = require('webpack') +var path = require('path') +require('dotenv').config() + +module.exports = { + mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', + entry: './app/client/index.jsx', + watch: true, + devtool: 'cheap-source-map', + output: { + path: __dirname + '/public', + filename: 'bundle.js', + }, + module: { + rules: [ + { + test: /\.jsx?$/, + exclude: /(node_modules|bower_components)/, + use: { + loader: 'babel-loader', + options: { + presets: ['env','es2015','stage-0'], + } + } + }, + { + test: /\.css$/, + use: [ 'style-loader', 'css-loader' ] + }, + ] + }, + resolve: { + alias: { + 'react': 'preact-compat', + 'react-dom': 'preact-compat', + } + }, + devServer: { + contentBase: path.join(__dirname, 'public'), + compress: true, + } +} |
