-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
55 lines (52 loc) · 1.51 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
50
51
52
53
54
55
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const { DefinePlugin, HotModuleReplacementPlugin, NamedModulesPlugin } = require('webpack');
const { join, resolve } = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
require('dotenv').config();
const PUBLIC_URL = process.env.PUBLIC_URL || '/';
module.exports = {
entry: './src/index.ts',
devtool: 'source-map',
devServer: {
contentBase: './dist',
hot: true
},
mode: 'development',
module: {
rules: [
{
test: /\.[jt]s$/,
include: [
join(__dirname, 'src'),
join(__dirname, 'node_modules/botbuilder-core/lib')
],
use: ['babel-loader']
}
]
},
plugins: [
new CleanWebpackPlugin(),
new NamedModulesPlugin(),
new HotModuleReplacementPlugin(),
new CopyWebpackPlugin([
{ from: resolve(__dirname, 'index.html'), to: '' },
{ from: resolve(__dirname, 'src/assets'), to: 'assets' },
{ from: resolve(__dirname, 'src/public'), to: 'public' }
]),
new DefinePlugin({
'process.env.PUBLIC_URL': JSON.stringify(PUBLIC_URL)
})
],
resolve: {
extensions: ['.css', '.js', '.ts']
},
output: {
filename: 'index.js',
path: resolve(__dirname, 'dist')
},
node: {
fs: 'empty',
net: 'empty',
tls: 'empty'
}
};