/
server.production.js
41 lines (37 loc) · 1.05 KB
/
server.production.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: path.resolve(__dirname, ``, `src/server/index.js`),
output: {
filename: 'compiled.js",',
path: path.resolve(__dirname,'', 'dist'),
publicPath : '/dist/',
library: 'app',
libraryTarget:'commonjs2'
},
target: 'node',
externals: [nodeExternals()],
devtool: 'eval',
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
plugins: ["transform-react-jsx"],
presets: ['es2015', 'react', 'stage-2']
}
},
{
test: /\.scss$/,
loader: 'css-loader/locals'
},
]
}
};