-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
47 lines (45 loc) · 1.34 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
var path = require("path");
var webpack = require("webpack");
var TerserPlugin = require('terser-webpack-plugin');
var config = {
entry: {
"uirouter-redux": ["./core/index.ts"],
"uirouter-redux.min": ["./core/index.ts"],
"uirouter-redux-react": ["./react/index.ts"],
"uirouter-redux-react.min": ["./react/index.ts"],
},
output: {
path: path.resolve(__dirname, "_bundles"),
filename: "[name].js",
libraryTarget: "umd",
library: "UIRouterRedux",
umdNamedDefine: true,
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
optimization: {
minimizer: [
new TerserPlugin({
test: /\.min\.js$/,
}),
],
},
devtool: "source-map",
module: {
rules: [
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader",
exclude: /(node_modules|__tests__)/
}
]
},
externals: {
"react": { root: 'React', amd: 'react', commonjs2: 'react', commonjs: 'react' },
"prop-types": { root: 'PropTypes', amd: 'prop-types', commonjs2: 'prop-types', commonjs: 'prop-types' },
"@uirouter/core": { root: 'UIRouter', amd: '@uirouter/core', commonjs2: '@uirouter/core', commonjs: '@uirouter/core' },
"@uirouter/react": { root: 'UIRouterReact', amd: '@uirouter/react', commonjs2: '@uirouter/react', commonjs: '@uirouter/react' }
}
};
module.exports = config;