forked from neki-dev/izowave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (37 loc) · 853 Bytes
/
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
const path = require('path');
const webpack = require('webpack');
const alias = require('alias-reuse');
const tsconfig = require('./tsconfig.json');
module.exports = (_, { mode }) => ({
resolve: {
extensions: ['.js', '.ts'],
alias: alias(path.join(__dirname))
.fromTsconfig()
.toWebpack(),
},
target: 'web',
entry: path.join(__dirname, 'src/index.ts'),
output: {
path: path.join(__dirname, tsconfig.compilerOptions.outDir, 'dist'),
filename: 'bundle.js',
},
module: {
rules: [{
test: /\.ts$/,
use: 'babel-loader',
}],
},
devServer: {
static: {
directory: path.join(__dirname, 'app'),
},
compress: true,
port: 9000,
},
devtool: 'source-map',
plugins: [
new webpack.DefinePlugin({
'IS_DEV_MODE': JSON.stringify(mode === 'development')
})
]
});