-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.build.ts
54 lines (51 loc) · 1.19 KB
/
webpack.config.build.ts
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
import webpack from 'webpack';
import webpackMerge from 'webpack-merge';
import path from 'path';
import common from './webpack.config.common';
const ROOT_PATH = path.resolve(__dirname);
const config: webpack.Configuration = webpackMerge(common, {
mode: 'production',
entry: {
'material-ui-linkify': path.resolve(ROOT_PATH, 'src/index.ts'),
},
output: {
globalObject: "this",
path: path.resolve(ROOT_PATH, 'dist'),
filename: 'index.js',
library: 'MaterialUiLinkify',
libraryTarget: 'umd',
},
externals: [
{
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
'prop-types': {
commonjs: 'prop-types',
commonjs2: 'prop-types',
amd: 'prop-types',
root: 'PropTypes',
},
},
'@mui/material',
/@mui\/material\/*./,
],
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
__DEV__: false,
}),
],
});
export default config;