1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-25 05:43:32 +03:00
guide/front-ps/webpack.config.server.js
Jens Krause b804b5791b
Clone pux-starter-app
to have a base structure to build an `isomorphic` app
2017-07-01 16:56:09 +02:00

64 lines
1.3 KiB
JavaScript

const path = require('path')
const webpack = require('webpack')
const nodeExternals = require('webpack-node-externals')
const isProd = process.env.NODE_ENV === 'production'
const entries = [path.join(__dirname, 'support', 'server.entry.js')]
const plugins = [
new webpack.ProvidePlugin({
'XMLHttpRequest': 'xhr2'
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
]
module.exports = {
entry: entries,
target: 'node',
output: {
path: path.join(__dirname, 'dist'),
filename: 'server.js',
publicPath: '/',
libraryTarget: 'commonjs2'
},
module: {
loaders: [
{
test: /\.purs$/,
loader: 'purs-loader',
exclude: /node_modules/,
query: {}
}
],
},
plugins: plugins,
externals: [nodeExternals({
whitelist: ['XMLHttpRequest', 'webpack/hot/poll?1000'],
})],
resolve: {
alias: {
'react': 'preact-compat',
'react-dom': 'preact-compat'
},
modules: [
'node_modules'
],
extensions: ['.js', '.purs']
},
performance: { hints: false },
stats: {
hash: false,
timings: false,
version: false,
assets: false,
errors: true,
colors: false,
chunks: false,
children: false,
cached: false,
modules: false,
chunkModules: false
}
}