-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.lib.config-prev.js
64 lines (63 loc) · 1.46 KB
/
webpack.lib.config-prev.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const path = require('path');
module.exports = {
mode: 'production',
entry: path.resolve(__dirname, 'src/index-ui.ts'),
output: {
filename: 'index-ui.js',
path: path.resolve(__dirname, 'dist'),
library: {
name: 'QuickBloxUIKit',
type: 'umd',
},
globalObject: 'this',
clean: true,
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
},
externals: {
react: {
commonjs: 'react',
commonjs2: 'react',
amd: 'react',
root: 'React',
},
'react-dom': {
commonjs: 'react-dom',
commonjs2: 'react-dom',
amd: 'react-dom',
root: 'ReactDOM',
},
'react/jsx-runtime': 'react/jsx-runtime',
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: {
loader: 'ts-loader',
options: {
configFile: path.resolve(__dirname, 'tsconfig.buildlib.json'),
},
},
exclude: [/node_modules/, /stories/]
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.s[ac]ss$/i,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.(png|jpg|jpeg|gif|svg)$/i,
type: 'asset/resource',
},
],
},
experiments: {
outputModule: false, // Убираем `outputModule: true`, так как UMD не поддерживает ES модули
},
};