-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
41 lines (40 loc) · 1.37 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
var nodeExternals = require('webpack-node-externals')
const path = require('path')
const webpack = require('webpack')
module.exports = {
entry: './src/index.ts',
output: {
path: path.resolve(__dirname, 'lib'),
filename: '[name].js',
libraryTarget: 'umd',
library: 'Pando',
umdNamedDefine: true,
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
alias: {
'@root': path.resolve(__dirname, 'src/'),
// '@pando': path.resolve(__dirname, 'src/pando.ts'),
// '@factories': path.resolve(__dirname, 'src/factories/'),
// '@components': path.resolve(__dirname, 'src/components/'),
// '@objects': path.resolve(__dirname, 'src/objects/'),
// '@contracts': path.resolve(__dirname, 'src/contracts/'),
'@utils': path.resolve(__dirname, 'src/utils/'),
'@lib': path.resolve(__dirname, 'src/lib/'),
'@ui': path.resolve(__dirname, 'src/ui/'),
'@inquirer': path.resolve(__dirname, 'src/ui/inquirer')
// '@build': path.resolve(__dirname, 'build/'),
// "@interfaces": path.resolve(__dirname, 'src/interfaces/ipando.d.ts')
}
},
module: {
rules: [
{ test: /.tsx?$/, loader: 'ts-loader' }
]
},
plugins: [
new webpack.BannerPlugin({banner: '#!/usr/bin/env node', raw: true})
],
target: 'node', // in order to ignore built-in modules like path, fs, etc.
externals: [nodeExternals()],
}