-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (48 loc) · 1.27 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 webpack = require('webpack');
module.exports = {
devtool: 'inline-source-map',
entry: {
'pada': './src/bin/pada.ts',
'pada-add': './src/bin/pada-add.ts',
'pada-del': './src/bin/pada-del.ts',
'pada-update': './src/bin/pada-update.ts',
'pada-lang': './src/bin/pada-lang.ts',
'pada-list': './src/bin/pada-list.ts',
'pada-done': './src/bin/pada-done.ts',
'pada-config': './src/bin/pada-config.ts',
'sql': './src/utils/taskDB.ts'
},
target: 'node',
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist/@pada')
},
node: {
__dirname: false,
__filename: true,
},
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['.ts', '.tsx', '.js'],
modules: ['node_modules'],
alias: {
utils: path.resolve(__dirname, 'src/utils')
}
},
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: 'ts-loader' },
{
test: /\.ts$/,
enforce: 'pre',
loader: 'tslint-loader',
options: { /* Loader options go here */ }
}
]
},
plugins: [
new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true })
]
}