-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (41 loc) · 912 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
39
40
41
42
import webpack from 'webpack';
import yargs from 'yargs';
const prod = yargs.argv.prod;
module.exports = {
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
presets: [ '@babel/preset-env', 'babel-preset-airbnb' ],
plugins: [ '@babel/plugin-syntax-dynamic-import', '@babel/plugin-transform-runtime' ]
}
}
]
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]
},
mode: prod ? 'production' : 'development',
devServer: {
historyApiFallback: true
},
devtool: !prod ? 'inline-source-map' : false,
output: {
filename: '[name].js',
chunkFilename: '[name].bundle.js'
}
// externals: {
// jquery: 'jQuery'
// },
// plugins: [
// // Set dependencies in global scope
// // https://webpack.js.org/plugins/provide-plugin/
// new webpack.ProvidePlugin({
// $: 'jquery',
// jQuery: 'jquery'
// })
// ]
};