-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
49 lines (47 loc) · 1.17 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const path = require('path');
const slswp = require('serverless-webpack');
const tsConfigPathPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
mode: slswp.lib.webpack.isLocal ? 'development' : 'production',
context: __dirname,
entry: slswp.lib.entries,
devtool: slswp.lib.webpack.isLocal ? 'eval-cheap-module-source-map' : 'source-map',
output: {
libraryTarget: 'commonjs',
path: path.join(__dirname, '.webpack'),
filename: '[name].js',
},
resolve: {
extensions: ['.ts', '.json'],
symlinks: false,
cacheWithContext: false,
plugins: [
new tsConfigPathPlugin(),
],
},
optimization: {
concatenateModules: false,
},
target: 'node',
externals: [require('webpack-node-externals')()],
module: {
rules: [
{
test: /\.tsx?$/,
exclude: [
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, '.webpack'),
path.resolve(__dirname, '.serverless')
],
use: {
loader: 'ts-loader',
options: {
transpileOnly: true,
experimentalWatchApi: true
}
}
}
]
},
plugins: []
};