-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
33 lines (32 loc) · 1.18 KB
/
webpack.config.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
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './src/server.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'server.js',
publicPath: '/',
},
target: 'node',
externals: nodeExternals(),
plugins: [
new webpack.DefinePlugin({ 'process.env': { NODE_ENV: 'production' } }),
new CopyWebpackPlugin([{ context: './src/', from: 'schemas/*', to: '.', ignore: ['package.json'], force: true }], { copyUnmodified: true }),
new CopyWebpackPlugin([{ context: './src/', from: 'data/*', to: '.', ignore: ['package.json'], force: true }], { copyUnmodified: true }),
new CopyWebpackPlugin([{ context: './src/', from: 'winstonResults.log', to: '.', force: true }], { copyUnmodified: true }),
new CopyWebpackPlugin([{ context: './', from: 'doc/**', to: '.', force: true }], { copyUnmodified: true }),
],
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['react'],
},
},
],
},
};