forked from fayster/react-toastify-redux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (43 loc) · 1.05 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
const webpack = require('webpack');
const path = require('path');
module.exports = {
mode: process.env.NODE_ENV || 'production',
devtool: 'source-map',
entry: './src/index.ts',
output: {
path: __dirname + "/dist",
filename: 'ReactToastifyRedux.js',
libraryTarget: 'umd',
library: 'ReactToastifyRedux'
},
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: ['babel-loader', 'awesome-typescript-loader']
}
]
},
resolve: {
modules: ['node_modules'],
extensions: ['.js', '.jsx', '.tsx', '.ts'],
alias: {
react: path.resolve('./node_modules/react'),
'react-dom': path.resolve('./node_modules/react-dom'),
'react-toasify': path.resolve('./node_modules/react-toastify'),
'react-redux': path.resolve('./node_modules/react-redux')
}
},
externals: [
'react',
'react-dom',
'react-toastify',
'react-redux'
],
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
]
};