1
const path = require('path');
2
const { DefinePlugin} = require('webpack');
3
const nodeExternals = require('webpack-node-externals');
5
const NODE_ENV = process.env.NODE_ENV;
6
const GLOBAL_CSS_REGEXP = /\.global\.css$/;
7
const IS_DEV = NODE_ENV === 'development';
11
mode: NODE_ENV ? NODE_ENV : 'development',
12
entry: path.resolve(__dirname, '../src/server/server.js'),
14
path: path.resolve(__dirname, '../dist/server'),
18
extensions: ['.jsx', '.js', '.json','.ts','.tsx']
20
externals: [nodeExternals()],
24
test: /\.(js|jsx|ts|tsx)$/,
25
exclude: /nodeModules/,
27
loader: "babel-loader"
37
localIdentName: '[name]__[local]--[hash:base64:5]',
38
exportOnlyLocals: true
42
exclude: GLOBAL_CSS_REGEXP
45
test: GLOBAL_CSS_REGEXP,
52
devtool: IS_DEV ? 'eval' :false,
53
plugins: [ new DefinePlugin({'process.env.CLIENT_ID':`'${process.env.CLIENT_ID}'` })]