-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
43 lines (41 loc) · 907 Bytes
/
webpack.config.js
File metadata and controls
43 lines (41 loc) · 907 Bytes
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
const path = require('path');
const slsw = require('serverless-webpack');
const webpack = require('webpack');
const npmPackageVersion = require('./package.json').version;
module.exports = {
devtool: 'source-map',
entry: slsw.lib.entries,
resolve: {
extensions: [
'.js',
'.json',
'.ts',
'.tsx'
]
},
output: {
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
// devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]',
libraryTarget: 'commonjs',
path: path.join(__dirname, '.webpack'),
filename: '[name].js'
},
target: 'node',
plugins: [
new webpack.DefinePlugin({
'__NPM_PACKAGE_VERSION__': JSON.stringify(npmPackageVersion)
}),
],
module: {
rules: [
{
test: /\.ts(x?)$/,
use: [
{
loader: 'ts-loader'
}
],
}
]
}
};