-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.server.config.js
38 lines (35 loc) · 1.06 KB
/
webpack.server.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
34
35
36
37
38
"use strict";
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const webpack = require("webpack");
const path = require("path");
const baseWebpackConfig = require("./webpack.config");
var nodeExternals = require('webpack-node-externals');
module.exports = Object.assign({}, baseWebpackConfig, {
target: 'node',
externals: [nodeExternals()],
entry: {
index: [
path.resolve(__dirname, "src/serverApp.tsx"),
],
styles: [
path.resolve(__dirname, "src/app.less"),
],
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'functions'),
libraryTarget: 'commonjs2',
publicPath: "/",
},
plugins: [
...baseWebpackConfig.plugins,
new WebpackBuildNotifierPlugin({
title: "Momo Tabs Build - Server",
}),
new CopyWebpackPlugin([ "package.json", ".npmrc" ]),
new webpack.DefinePlugin({
__SERVER__: true
})
],
});