123456789101112131415161718192021222324252627282930313233 |
- var fs = require('fs')
- var path = require('path')
- module.exports = {
- entry: path.resolve(__dirname, 'server.js'),
- output: {
- filename: 'server.bundle.js'
- },
- target: 'node',
- // keep node_module paths out of the bundle
- externals: fs.readdirSync(path.resolve(__dirname, 'node_modules')).concat([
- 'react-dom/server'
- ]).reduce(function (ext, mod) {
- ext[mod] = 'commonjs ' + mod
- return ext
- }, {}),
- node: {
- __filename: false,
- __dirname: false
- },
- module: {
- loaders: [
- { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader?presets[]=es2015&presets[]=react' }
- ]
- }
- }
|