generated from arabold/serverless-react-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.server.config.js
59 lines (58 loc) · 1.33 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const path = require("path");
const slsw = require("serverless-webpack");
module.exports = {
entry: slsw.lib.entries,
target: "node",
mode: slsw.lib.webpack.isLocal ? "development" : "production",
optimization: {
// We don't need to minimize our Lambda code.
minimize: false,
},
performance: {
// Turn off size warnings for entry points
hints: false,
},
devtool: "nosources-source-map",
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/, // we shouldn't need processing `node_modules`
use: [
{
loader: "babel-loader",
},
],
},
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: [
{
loader: "babel-loader",
},
{
loader: "ts-loader",
},
],
},
{
test: /\.css$/,
use: "null-loader", // No server-side CSS processing
},
{
test: /\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$/,
use: "url-loader",
},
],
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx"],
},
output: {
libraryTarget: "commonjs2",
path: path.join(__dirname, ".webpack"),
filename: "[name].js",
sourceMapFilename: "[file].map",
},
};