forked from ui-router/react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
37 lines (35 loc) · 889 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
const path = require('path');
const webpack = require('webpack');
const isdev = (process.env.NODE_ENV || 'development') === 'development';
const config = {
mode: isdev ? 'development' : 'production',
watch: process.env.WATCH === 'true',
devtool: 'source-map',
entry: {
'ui-router-react': ['./src/index.ts'],
'ui-router-react.min': ['./src/index.ts'],
},
output: {
path: path.resolve(__dirname, '_bundles'),
filename: '[name].js',
libraryTarget: 'umd',
library: 'UIRouterReact',
umdNamedDefine: true,
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /(node_modules|__tests__)/,
},
],
},
externals: {
react: { root: 'React', amd: 'react', commonjs2: 'react', commonjs: 'react' },
},
};
module.exports = config;