@vyriy/webpack-config 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +85 -0
- package/babel.d.ts +2 -0
- package/babel.js +33 -0
- package/csr.d.ts +2 -0
- package/csr.js +49 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/mode.d.ts +2 -0
- package/mode.js +2 -0
- package/optimization.d.ts +2 -0
- package/optimization.js +17 -0
- package/package.json +142 -0
- package/performance.d.ts +2 -0
- package/performance.js +3 -0
- package/postcss.d.ts +5 -0
- package/postcss.js +26 -0
- package/resolve.d.ts +2 -0
- package/resolve.js +35 -0
- package/rules.d.ts +4 -0
- package/rules.js +31 -0
- package/ssr.d.ts +2 -0
- package/ssr.js +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vyriy contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# @vyriy/webpack-config
|
|
2
|
+
|
|
3
|
+
Shared Webpack config for Vyriy projects.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This package provides two small typed Webpack config generators for Vyriy client and server builds.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
With npm:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @vyriy/webpack-config webpack webpack-cli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
With Yarn:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
yarn add @vyriy/webpack-config webpack webpack-cli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Install `webpack` and `webpack-cli` in the consumer project so Webpack CLI commands are available.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
For client bundles:
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { csr } from '@vyriy/webpack-config';
|
|
31
|
+
|
|
32
|
+
export default csr('./src/index.tsx', {
|
|
33
|
+
path: '/absolute/path/to/dist/client',
|
|
34
|
+
filename: 'index.js',
|
|
35
|
+
clean: true,
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For SSR bundles:
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import { ssr } from '@vyriy/webpack-config';
|
|
43
|
+
|
|
44
|
+
export default ssr(['@w/api'], {
|
|
45
|
+
path: '/absolute/path/to/dist/api',
|
|
46
|
+
filename: 'index.js',
|
|
47
|
+
library: { type: 'commonjs2' },
|
|
48
|
+
clean: true,
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The second parameter is a regular Webpack `output` config passed as-is.
|
|
53
|
+
|
|
54
|
+
Both generators accept a third parameter with local Webpack overrides that are merged over the shared defaults:
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
import { csr } from '@vyriy/webpack-config';
|
|
58
|
+
|
|
59
|
+
export default csr(
|
|
60
|
+
'./src/index.tsx',
|
|
61
|
+
{
|
|
62
|
+
path: '/absolute/path/to/dist/client',
|
|
63
|
+
filename: 'index.js',
|
|
64
|
+
clean: true,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
output: {
|
|
68
|
+
filename: 'app.js',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## API
|
|
75
|
+
|
|
76
|
+
- `csr(entry, output, config?)` creates a browser-oriented Webpack config.
|
|
77
|
+
- `ssr(entry, output, config?)` creates a node-oriented SSR Webpack config.
|
|
78
|
+
|
|
79
|
+
Shared defaults:
|
|
80
|
+
|
|
81
|
+
- `devtool: false`
|
|
82
|
+
- `mode`: `production` when `NODE_ENV=production`, otherwise `development`
|
|
83
|
+
- `performance.hints: false`
|
|
84
|
+
- production `optimization` with `TerserPlugin`
|
|
85
|
+
- merged `resolve` defaults
|
package/babel.d.ts
ADDED
package/babel.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const babel = (isSsr = false, isProduction = true) => {
|
|
2
|
+
const isClientDevelopment = !isProduction && !isSsr;
|
|
3
|
+
const envOptions = {
|
|
4
|
+
bugfixes: true,
|
|
5
|
+
modules: false,
|
|
6
|
+
...(isSsr ? { targets: { node: 'current' } } : {}),
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
presets: [
|
|
10
|
+
[
|
|
11
|
+
'@babel/preset-env',
|
|
12
|
+
envOptions,
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
'@babel/preset-react',
|
|
16
|
+
{
|
|
17
|
+
runtime: 'automatic',
|
|
18
|
+
development: !isProduction,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
'@babel/preset-typescript',
|
|
22
|
+
],
|
|
23
|
+
plugins: [
|
|
24
|
+
[
|
|
25
|
+
'@babel/plugin-transform-runtime',
|
|
26
|
+
{
|
|
27
|
+
regenerator: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
...(isClientDevelopment ? ['react-refresh/babel'] : []),
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
};
|
package/csr.d.ts
ADDED
package/csr.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { path } from '@vyriy/path';
|
|
2
|
+
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
|
|
3
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
4
|
+
import { mode } from './mode.js';
|
|
5
|
+
import { optimization } from './optimization.js';
|
|
6
|
+
import { performance } from './performance.js';
|
|
7
|
+
import { resolve } from './resolve.js';
|
|
8
|
+
import { rules } from './rules.js';
|
|
9
|
+
export const csr = (entry, output, config = {}) => {
|
|
10
|
+
const webpackMode = mode();
|
|
11
|
+
const isProduction = webpackMode === 'production';
|
|
12
|
+
const base = {
|
|
13
|
+
context: path(),
|
|
14
|
+
devtool: false,
|
|
15
|
+
mode: webpackMode,
|
|
16
|
+
target: isProduction ? 'browserslist' : 'web',
|
|
17
|
+
entry,
|
|
18
|
+
output,
|
|
19
|
+
module: {
|
|
20
|
+
rules: rules(false, isProduction),
|
|
21
|
+
},
|
|
22
|
+
optimization: optimization(isProduction),
|
|
23
|
+
performance,
|
|
24
|
+
plugins: isProduction ? [new MiniCssExtractPlugin()] : [new ReactRefreshWebpackPlugin()],
|
|
25
|
+
resolve: resolve(config.resolve),
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
...base,
|
|
29
|
+
...config,
|
|
30
|
+
output: {
|
|
31
|
+
...base.output,
|
|
32
|
+
...config.output,
|
|
33
|
+
},
|
|
34
|
+
module: {
|
|
35
|
+
...base.module,
|
|
36
|
+
...config.module,
|
|
37
|
+
rules: config.module?.rules ?? base.module?.rules,
|
|
38
|
+
},
|
|
39
|
+
optimization: base.optimization
|
|
40
|
+
? {
|
|
41
|
+
...base.optimization,
|
|
42
|
+
...config.optimization,
|
|
43
|
+
}
|
|
44
|
+
: config.optimization,
|
|
45
|
+
performance: config.performance ?? performance,
|
|
46
|
+
plugins: config.plugins ?? base.plugins,
|
|
47
|
+
resolve: resolve(config.resolve),
|
|
48
|
+
};
|
|
49
|
+
};
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/mode.d.ts
ADDED
package/mode.js
ADDED
package/optimization.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import TerserPlugin from 'terser-webpack-plugin';
|
|
2
|
+
export const optimization = (isProduction = true) => isProduction
|
|
3
|
+
? {
|
|
4
|
+
minimize: true,
|
|
5
|
+
splitChunks: false,
|
|
6
|
+
minimizer: [
|
|
7
|
+
new TerserPlugin({
|
|
8
|
+
extractComments: false,
|
|
9
|
+
terserOptions: {
|
|
10
|
+
format: {
|
|
11
|
+
comments: false,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}),
|
|
15
|
+
],
|
|
16
|
+
}
|
|
17
|
+
: undefined;
|
package/package.json
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vyriy/webpack-config",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"description": "Shared Webpack config for Vyriy projects",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@babel/core": "^7.29.0",
|
|
9
|
+
"@babel/plugin-transform-runtime": "^7.29.0",
|
|
10
|
+
"@babel/preset-env": "^7.29.5",
|
|
11
|
+
"@babel/preset-react": "^7.28.5",
|
|
12
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
13
|
+
"@babel/runtime": "^7.29.2",
|
|
14
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
|
|
15
|
+
"@vyriy/env": "0.1.9",
|
|
16
|
+
"@vyriy/path": "0.1.9",
|
|
17
|
+
"babel-loader": "^10.1.1",
|
|
18
|
+
"css-loader": "^7.1.4",
|
|
19
|
+
"cssnano": "^8.0.1",
|
|
20
|
+
"mini-css-extract-plugin": "^2.10.2",
|
|
21
|
+
"null-loader": "^4.0.1",
|
|
22
|
+
"postcss": "^8.5.14",
|
|
23
|
+
"postcss-loader": "^8.2.1",
|
|
24
|
+
"postcss-preset-env": "^11.2.1",
|
|
25
|
+
"react-refresh": "^0.18.0",
|
|
26
|
+
"sass": "^1.99.0",
|
|
27
|
+
"sass-loader": "^16.0.8",
|
|
28
|
+
"style-loader": "^4.0.0",
|
|
29
|
+
"terser-webpack-plugin": "^5.6.0",
|
|
30
|
+
"webpack": "^5.106.2",
|
|
31
|
+
"webpack-cli": "^7.0.2"
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"types": "./index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./index.d.ts",
|
|
38
|
+
"import": "./index.js",
|
|
39
|
+
"default": "./index.js"
|
|
40
|
+
},
|
|
41
|
+
"./babel": {
|
|
42
|
+
"types": "./babel.d.ts",
|
|
43
|
+
"import": "./babel.js",
|
|
44
|
+
"default": "./babel.js"
|
|
45
|
+
},
|
|
46
|
+
"./babel.js": {
|
|
47
|
+
"types": "./babel.d.ts",
|
|
48
|
+
"import": "./babel.js",
|
|
49
|
+
"default": "./babel.js"
|
|
50
|
+
},
|
|
51
|
+
"./csr": {
|
|
52
|
+
"types": "./csr.d.ts",
|
|
53
|
+
"import": "./csr.js",
|
|
54
|
+
"default": "./csr.js"
|
|
55
|
+
},
|
|
56
|
+
"./csr.js": {
|
|
57
|
+
"types": "./csr.d.ts",
|
|
58
|
+
"import": "./csr.js",
|
|
59
|
+
"default": "./csr.js"
|
|
60
|
+
},
|
|
61
|
+
"./index": {
|
|
62
|
+
"types": "./index.d.ts",
|
|
63
|
+
"import": "./index.js",
|
|
64
|
+
"default": "./index.js"
|
|
65
|
+
},
|
|
66
|
+
"./index.js": {
|
|
67
|
+
"types": "./index.d.ts",
|
|
68
|
+
"import": "./index.js",
|
|
69
|
+
"default": "./index.js"
|
|
70
|
+
},
|
|
71
|
+
"./mode": {
|
|
72
|
+
"types": "./mode.d.ts",
|
|
73
|
+
"import": "./mode.js",
|
|
74
|
+
"default": "./mode.js"
|
|
75
|
+
},
|
|
76
|
+
"./mode.js": {
|
|
77
|
+
"types": "./mode.d.ts",
|
|
78
|
+
"import": "./mode.js",
|
|
79
|
+
"default": "./mode.js"
|
|
80
|
+
},
|
|
81
|
+
"./optimization": {
|
|
82
|
+
"types": "./optimization.d.ts",
|
|
83
|
+
"import": "./optimization.js",
|
|
84
|
+
"default": "./optimization.js"
|
|
85
|
+
},
|
|
86
|
+
"./optimization.js": {
|
|
87
|
+
"types": "./optimization.d.ts",
|
|
88
|
+
"import": "./optimization.js",
|
|
89
|
+
"default": "./optimization.js"
|
|
90
|
+
},
|
|
91
|
+
"./performance": {
|
|
92
|
+
"types": "./performance.d.ts",
|
|
93
|
+
"import": "./performance.js",
|
|
94
|
+
"default": "./performance.js"
|
|
95
|
+
},
|
|
96
|
+
"./performance.js": {
|
|
97
|
+
"types": "./performance.d.ts",
|
|
98
|
+
"import": "./performance.js",
|
|
99
|
+
"default": "./performance.js"
|
|
100
|
+
},
|
|
101
|
+
"./postcss": {
|
|
102
|
+
"types": "./postcss.d.ts",
|
|
103
|
+
"import": "./postcss.js",
|
|
104
|
+
"default": "./postcss.js"
|
|
105
|
+
},
|
|
106
|
+
"./postcss.js": {
|
|
107
|
+
"types": "./postcss.d.ts",
|
|
108
|
+
"import": "./postcss.js",
|
|
109
|
+
"default": "./postcss.js"
|
|
110
|
+
},
|
|
111
|
+
"./resolve": {
|
|
112
|
+
"types": "./resolve.d.ts",
|
|
113
|
+
"import": "./resolve.js",
|
|
114
|
+
"default": "./resolve.js"
|
|
115
|
+
},
|
|
116
|
+
"./resolve.js": {
|
|
117
|
+
"types": "./resolve.d.ts",
|
|
118
|
+
"import": "./resolve.js",
|
|
119
|
+
"default": "./resolve.js"
|
|
120
|
+
},
|
|
121
|
+
"./rules": {
|
|
122
|
+
"types": "./rules.d.ts",
|
|
123
|
+
"import": "./rules.js",
|
|
124
|
+
"default": "./rules.js"
|
|
125
|
+
},
|
|
126
|
+
"./rules.js": {
|
|
127
|
+
"types": "./rules.d.ts",
|
|
128
|
+
"import": "./rules.js",
|
|
129
|
+
"default": "./rules.js"
|
|
130
|
+
},
|
|
131
|
+
"./ssr": {
|
|
132
|
+
"types": "./ssr.d.ts",
|
|
133
|
+
"import": "./ssr.js",
|
|
134
|
+
"default": "./ssr.js"
|
|
135
|
+
},
|
|
136
|
+
"./ssr.js": {
|
|
137
|
+
"types": "./ssr.d.ts",
|
|
138
|
+
"import": "./ssr.js",
|
|
139
|
+
"default": "./ssr.js"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
package/performance.d.ts
ADDED
package/performance.js
ADDED
package/postcss.d.ts
ADDED
package/postcss.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import cssnano from 'cssnano';
|
|
2
|
+
import postcssPresetEnv from 'postcss-preset-env';
|
|
3
|
+
const DEFAULT_PLUGINS = [
|
|
4
|
+
postcssPresetEnv({
|
|
5
|
+
stage: 3,
|
|
6
|
+
autoprefixer: {
|
|
7
|
+
flexbox: 'no-2009',
|
|
8
|
+
},
|
|
9
|
+
}),
|
|
10
|
+
cssnano({
|
|
11
|
+
preset: [
|
|
12
|
+
'default',
|
|
13
|
+
{
|
|
14
|
+
cssDeclarationSorter: false,
|
|
15
|
+
zindex: false,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
}),
|
|
19
|
+
];
|
|
20
|
+
export const postcss = (config = {}) => ({
|
|
21
|
+
...config,
|
|
22
|
+
plugins: [
|
|
23
|
+
...DEFAULT_PLUGINS,
|
|
24
|
+
...(config.plugins ?? []),
|
|
25
|
+
],
|
|
26
|
+
});
|
package/resolve.d.ts
ADDED
package/resolve.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const BASE_EXTENSION_ALIAS = {
|
|
2
|
+
'.js': [
|
|
3
|
+
'.ts',
|
|
4
|
+
'.tsx',
|
|
5
|
+
'.js',
|
|
6
|
+
],
|
|
7
|
+
'.mjs': [
|
|
8
|
+
'.mts',
|
|
9
|
+
'.mjs',
|
|
10
|
+
],
|
|
11
|
+
'.cjs': [
|
|
12
|
+
'.cts',
|
|
13
|
+
'.cjs',
|
|
14
|
+
],
|
|
15
|
+
};
|
|
16
|
+
const BASE_EXTENSIONS = [
|
|
17
|
+
'.tsx',
|
|
18
|
+
'.ts',
|
|
19
|
+
'.jsx',
|
|
20
|
+
'.js',
|
|
21
|
+
'.mjs',
|
|
22
|
+
'.cjs',
|
|
23
|
+
'.json',
|
|
24
|
+
];
|
|
25
|
+
export const resolve = (config = {}) => ({
|
|
26
|
+
...config,
|
|
27
|
+
extensionAlias: {
|
|
28
|
+
...BASE_EXTENSION_ALIAS,
|
|
29
|
+
...config.extensionAlias,
|
|
30
|
+
},
|
|
31
|
+
extensions: [
|
|
32
|
+
...BASE_EXTENSIONS,
|
|
33
|
+
...(config.extensions ?? []),
|
|
34
|
+
],
|
|
35
|
+
});
|
package/rules.d.ts
ADDED
package/rules.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
2
|
+
import { babel } from './babel.js';
|
|
3
|
+
import { postcss } from './postcss.js';
|
|
4
|
+
export const SCRIPT_TEST = /\.(mjs|cjs|js|jsx|mts|cts|ts|tsx)$/;
|
|
5
|
+
export const STYLE_TEST = /\.(css|scss|sass)$/;
|
|
6
|
+
export const rules = (isSsr = false, isProduction = true) => [
|
|
7
|
+
{
|
|
8
|
+
test: SCRIPT_TEST,
|
|
9
|
+
exclude: /node_modules/,
|
|
10
|
+
use: {
|
|
11
|
+
loader: 'babel-loader',
|
|
12
|
+
options: babel(isSsr, isProduction),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
test: STYLE_TEST,
|
|
17
|
+
use: isSsr
|
|
18
|
+
? ['null-loader']
|
|
19
|
+
: [
|
|
20
|
+
isProduction ? MiniCssExtractPlugin.loader : 'style-loader',
|
|
21
|
+
'css-loader',
|
|
22
|
+
{
|
|
23
|
+
loader: 'postcss-loader',
|
|
24
|
+
options: {
|
|
25
|
+
postcssOptions: postcss(),
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
'sass-loader',
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
];
|
package/ssr.d.ts
ADDED
package/ssr.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { mode } from './mode.js';
|
|
2
|
+
import { optimization } from './optimization.js';
|
|
3
|
+
import { performance } from './performance.js';
|
|
4
|
+
import { resolve } from './resolve.js';
|
|
5
|
+
import { rules } from './rules.js';
|
|
6
|
+
export const ssr = (entry, output, config = {}) => {
|
|
7
|
+
const webpackMode = mode();
|
|
8
|
+
const isProduction = webpackMode === 'production';
|
|
9
|
+
const base = {
|
|
10
|
+
devtool: false,
|
|
11
|
+
mode: webpackMode,
|
|
12
|
+
target: 'node',
|
|
13
|
+
entry,
|
|
14
|
+
output,
|
|
15
|
+
module: {
|
|
16
|
+
rules: rules(true, isProduction),
|
|
17
|
+
},
|
|
18
|
+
optimization: optimization(isProduction),
|
|
19
|
+
performance,
|
|
20
|
+
resolve: resolve(config.resolve),
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
...base,
|
|
24
|
+
...config,
|
|
25
|
+
output: {
|
|
26
|
+
...base.output,
|
|
27
|
+
...config.output,
|
|
28
|
+
library: config.output?.library ?? base.output?.library,
|
|
29
|
+
},
|
|
30
|
+
module: {
|
|
31
|
+
...base.module,
|
|
32
|
+
...config.module,
|
|
33
|
+
rules: config.module?.rules ?? base.module?.rules,
|
|
34
|
+
},
|
|
35
|
+
optimization: base.optimization
|
|
36
|
+
? {
|
|
37
|
+
...base.optimization,
|
|
38
|
+
...config.optimization,
|
|
39
|
+
}
|
|
40
|
+
: config.optimization,
|
|
41
|
+
performance: config.performance ?? performance,
|
|
42
|
+
resolve: resolve(config.resolve),
|
|
43
|
+
};
|
|
44
|
+
};
|