path-serializer 0.0.2 → 0.0.3
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/dist/cjs/main.cjs +185 -251
- package/dist/esm/main.js +204 -271
- package/dist/rsbuild.config.cjs.mjs +333 -0
- package/dist/rsbuild.config.esm.mjs +339 -0
- package/dist/rspack.config.cjs.mjs +420 -0
- package/dist/rspack.config.esm.mjs +422 -0
- package/package.json +1 -1
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
target: [
|
|
3
|
+
'es2022',
|
|
4
|
+
'node'
|
|
5
|
+
],
|
|
6
|
+
name: 'esm',
|
|
7
|
+
devtool: false,
|
|
8
|
+
context: '/Users/bytedance/Documents/codes/path-serializer',
|
|
9
|
+
mode: 'production',
|
|
10
|
+
infrastructureLogging: {
|
|
11
|
+
level: 'error'
|
|
12
|
+
},
|
|
13
|
+
experiments: {
|
|
14
|
+
asyncWebAssembly: true,
|
|
15
|
+
outputModule: true,
|
|
16
|
+
rspackFuture: {
|
|
17
|
+
bundlerInfo: {
|
|
18
|
+
force: false,
|
|
19
|
+
version: '1.0.0-beta.2',
|
|
20
|
+
bundler: 'rspack'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
externals: [
|
|
25
|
+
'assert',
|
|
26
|
+
'assert/strict',
|
|
27
|
+
'async_hooks',
|
|
28
|
+
'buffer',
|
|
29
|
+
'child_process',
|
|
30
|
+
'cluster',
|
|
31
|
+
'console',
|
|
32
|
+
'constants',
|
|
33
|
+
'crypto',
|
|
34
|
+
'dgram',
|
|
35
|
+
'diagnostics_channel',
|
|
36
|
+
'dns',
|
|
37
|
+
'dns/promises',
|
|
38
|
+
'domain',
|
|
39
|
+
'events',
|
|
40
|
+
'fs',
|
|
41
|
+
'fs/promises',
|
|
42
|
+
'http',
|
|
43
|
+
'http2',
|
|
44
|
+
'https',
|
|
45
|
+
'inspector',
|
|
46
|
+
'inspector/promises',
|
|
47
|
+
'module',
|
|
48
|
+
'net',
|
|
49
|
+
'os',
|
|
50
|
+
'path',
|
|
51
|
+
'path/posix',
|
|
52
|
+
'path/win32',
|
|
53
|
+
'perf_hooks',
|
|
54
|
+
'process',
|
|
55
|
+
'punycode',
|
|
56
|
+
'querystring',
|
|
57
|
+
'readline',
|
|
58
|
+
'readline/promises',
|
|
59
|
+
'repl',
|
|
60
|
+
'stream',
|
|
61
|
+
'stream/consumers',
|
|
62
|
+
'stream/promises',
|
|
63
|
+
'stream/web',
|
|
64
|
+
'string_decoder',
|
|
65
|
+
'sys',
|
|
66
|
+
'timers',
|
|
67
|
+
'timers/promises',
|
|
68
|
+
'tls',
|
|
69
|
+
'trace_events',
|
|
70
|
+
'tty',
|
|
71
|
+
'url',
|
|
72
|
+
'util',
|
|
73
|
+
'util/types',
|
|
74
|
+
'v8',
|
|
75
|
+
'vm',
|
|
76
|
+
'wasi',
|
|
77
|
+
'worker_threads',
|
|
78
|
+
'zlib',
|
|
79
|
+
/^node:/,
|
|
80
|
+
'pnpapi'
|
|
81
|
+
],
|
|
82
|
+
output: {
|
|
83
|
+
path: '/Users/bytedance/Documents/codes/path-serializer/dist/esm',
|
|
84
|
+
filename: '[name].js',
|
|
85
|
+
chunkFilename: '[name].js',
|
|
86
|
+
publicPath: '/',
|
|
87
|
+
pathinfo: false,
|
|
88
|
+
hashFunction: 'xxhash64',
|
|
89
|
+
library: {
|
|
90
|
+
type: 'modern-module'
|
|
91
|
+
},
|
|
92
|
+
webassemblyModuleFilename: 'static/wasm/[hash].module.wasm',
|
|
93
|
+
module: true,
|
|
94
|
+
chunkFormat: 'module'
|
|
95
|
+
},
|
|
96
|
+
resolve: {
|
|
97
|
+
alias: {
|
|
98
|
+
'@swc/helpers': '/Users/bytedance/Documents/codes/path-serializer/node_modules/.pnpm/@swc+helpers@0.5.11/node_modules/@swc/helpers'
|
|
99
|
+
},
|
|
100
|
+
extensions: [
|
|
101
|
+
'.ts',
|
|
102
|
+
'.tsx',
|
|
103
|
+
'.js',
|
|
104
|
+
'.jsx',
|
|
105
|
+
'.mjs',
|
|
106
|
+
'.json'
|
|
107
|
+
],
|
|
108
|
+
tsConfig: {
|
|
109
|
+
configFile: '/Users/bytedance/Documents/codes/path-serializer/tsconfig.json'
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
module: {
|
|
113
|
+
parser: {
|
|
114
|
+
javascript: {
|
|
115
|
+
exportsPresence: 'error'
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
rules: [
|
|
119
|
+
/* config.module.rule('mjs') */
|
|
120
|
+
{
|
|
121
|
+
test: /\.m?js/,
|
|
122
|
+
resolve: {
|
|
123
|
+
fullySpecified: false
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
/* config.module.rule('css') */
|
|
127
|
+
{
|
|
128
|
+
test: /\.css$/,
|
|
129
|
+
type: 'javascript/auto',
|
|
130
|
+
sideEffects: true,
|
|
131
|
+
use: [
|
|
132
|
+
/* config.module.rule('css').use('ignore-css') */
|
|
133
|
+
{
|
|
134
|
+
loader: '/Users/bytedance/Documents/codes/path-serializer/node_modules/.pnpm/@rsbuild+core@1.0.1-beta.10/node_modules/@rsbuild/core/dist/ignoreCssLoader.cjs'
|
|
135
|
+
},
|
|
136
|
+
/* config.module.rule('css').use('css') */
|
|
137
|
+
{
|
|
138
|
+
loader: '/Users/bytedance/Documents/codes/path-serializer/node_modules/.pnpm/@rsbuild+core@1.0.1-beta.10/node_modules/@rsbuild/core/compiled/css-loader',
|
|
139
|
+
options: {
|
|
140
|
+
importLoaders: 0,
|
|
141
|
+
modules: {
|
|
142
|
+
auto: true,
|
|
143
|
+
namedExport: false,
|
|
144
|
+
exportGlobals: false,
|
|
145
|
+
exportLocalsConvention: 'camelCase',
|
|
146
|
+
localIdentName: '[local]-[hash:base64:6]',
|
|
147
|
+
exportOnlyLocals: true
|
|
148
|
+
},
|
|
149
|
+
sourceMap: false
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
resolve: {
|
|
154
|
+
preferRelative: true
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
/* config.module.rule('js') */
|
|
158
|
+
{
|
|
159
|
+
test: /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/,
|
|
160
|
+
type: 'javascript/auto',
|
|
161
|
+
include: [
|
|
162
|
+
{
|
|
163
|
+
and: [
|
|
164
|
+
'/Users/bytedance/Documents/codes/path-serializer',
|
|
165
|
+
{
|
|
166
|
+
not: /[\\/]node_modules[\\/]/
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
/\.(?:ts|tsx|jsx|mts|cts)$/
|
|
171
|
+
],
|
|
172
|
+
use: [
|
|
173
|
+
/* config.module.rule('js').use('swc') */
|
|
174
|
+
{
|
|
175
|
+
loader: 'builtin:swc-loader',
|
|
176
|
+
options: {
|
|
177
|
+
jsc: {
|
|
178
|
+
externalHelpers: true,
|
|
179
|
+
parser: {
|
|
180
|
+
tsx: false,
|
|
181
|
+
syntax: 'typescript',
|
|
182
|
+
decorators: true
|
|
183
|
+
},
|
|
184
|
+
preserveAllComments: true,
|
|
185
|
+
experimental: {
|
|
186
|
+
cacheRoot: '/Users/bytedance/Documents/codes/path-serializer/node_modules/.cache/.swc'
|
|
187
|
+
},
|
|
188
|
+
transform: {
|
|
189
|
+
legacyDecorator: false,
|
|
190
|
+
decoratorVersion: '2022-03'
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
isModule: 'unknown',
|
|
194
|
+
env: {
|
|
195
|
+
targets: [
|
|
196
|
+
'last 1 node versions'
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
/* config.module.rule('js-data-uri') */
|
|
204
|
+
{
|
|
205
|
+
mimetype: {
|
|
206
|
+
or: [
|
|
207
|
+
'text/javascript',
|
|
208
|
+
'application/javascript'
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
use: [
|
|
212
|
+
/* config.module.rule('js-data-uri').use('swc') */
|
|
213
|
+
{
|
|
214
|
+
loader: 'builtin:swc-loader',
|
|
215
|
+
options: {
|
|
216
|
+
jsc: {
|
|
217
|
+
externalHelpers: true,
|
|
218
|
+
parser: {
|
|
219
|
+
tsx: false,
|
|
220
|
+
syntax: 'typescript',
|
|
221
|
+
decorators: true
|
|
222
|
+
},
|
|
223
|
+
preserveAllComments: true,
|
|
224
|
+
experimental: {
|
|
225
|
+
cacheRoot: '/Users/bytedance/Documents/codes/path-serializer/node_modules/.cache/.swc'
|
|
226
|
+
},
|
|
227
|
+
transform: {
|
|
228
|
+
legacyDecorator: false,
|
|
229
|
+
decoratorVersion: '2022-03'
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
isModule: 'unknown',
|
|
233
|
+
env: {
|
|
234
|
+
targets: [
|
|
235
|
+
'last 1 node versions'
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
resolve: {
|
|
242
|
+
fullySpecified: false
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
/* config.module.rule('image') */
|
|
246
|
+
{
|
|
247
|
+
test: /\.(?:png|jpg|jpeg|pjpeg|pjp|gif|bmp|webp|ico|apng|avif|tif|tiff|jfif)$/i,
|
|
248
|
+
oneOf: [
|
|
249
|
+
/* config.module.rule('image').oneOf('image-asset-url') */
|
|
250
|
+
{
|
|
251
|
+
type: 'asset/resource',
|
|
252
|
+
resourceQuery: /(__inline=false|url)/,
|
|
253
|
+
generator: {
|
|
254
|
+
filename: 'static/image/[name][ext]'
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
/* config.module.rule('image').oneOf('image-asset-inline') */
|
|
258
|
+
{
|
|
259
|
+
type: 'asset/inline',
|
|
260
|
+
resourceQuery: /inline/
|
|
261
|
+
},
|
|
262
|
+
/* config.module.rule('image').oneOf('image-asset') */
|
|
263
|
+
{
|
|
264
|
+
type: 'asset',
|
|
265
|
+
parser: {
|
|
266
|
+
dataUrlCondition: {
|
|
267
|
+
maxSize: 4096
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
generator: {
|
|
271
|
+
filename: 'static/image/[name][ext]'
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
/* config.module.rule('svg') */
|
|
277
|
+
{
|
|
278
|
+
test: /\.svg$/i,
|
|
279
|
+
oneOf: [
|
|
280
|
+
/* config.module.rule('svg').oneOf('svg-asset-url') */
|
|
281
|
+
{
|
|
282
|
+
type: 'asset/resource',
|
|
283
|
+
resourceQuery: /(__inline=false|url)/,
|
|
284
|
+
generator: {
|
|
285
|
+
filename: 'static/svg/[name].svg'
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
/* config.module.rule('svg').oneOf('svg-asset-inline') */
|
|
289
|
+
{
|
|
290
|
+
type: 'asset/inline',
|
|
291
|
+
resourceQuery: /inline/
|
|
292
|
+
},
|
|
293
|
+
/* config.module.rule('svg').oneOf('svg-asset') */
|
|
294
|
+
{
|
|
295
|
+
type: 'asset',
|
|
296
|
+
parser: {
|
|
297
|
+
dataUrlCondition: {
|
|
298
|
+
maxSize: 4096
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
generator: {
|
|
302
|
+
filename: 'static/svg/[name].svg'
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
},
|
|
307
|
+
/* config.module.rule('media') */
|
|
308
|
+
{
|
|
309
|
+
test: /\.(?:mp4|webm|ogg|mov|mp3|wav|flac|aac|m4a|opus)$/i,
|
|
310
|
+
oneOf: [
|
|
311
|
+
/* config.module.rule('media').oneOf('media-asset-url') */
|
|
312
|
+
{
|
|
313
|
+
type: 'asset/resource',
|
|
314
|
+
resourceQuery: /(__inline=false|url)/,
|
|
315
|
+
generator: {
|
|
316
|
+
filename: 'static/media/[name][ext]'
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
/* config.module.rule('media').oneOf('media-asset-inline') */
|
|
320
|
+
{
|
|
321
|
+
type: 'asset/inline',
|
|
322
|
+
resourceQuery: /inline/
|
|
323
|
+
},
|
|
324
|
+
/* config.module.rule('media').oneOf('media-asset') */
|
|
325
|
+
{
|
|
326
|
+
type: 'asset',
|
|
327
|
+
parser: {
|
|
328
|
+
dataUrlCondition: {
|
|
329
|
+
maxSize: 4096
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
generator: {
|
|
333
|
+
filename: 'static/media/[name][ext]'
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
/* config.module.rule('font') */
|
|
339
|
+
{
|
|
340
|
+
test: /\.(?:woff|woff2|eot|ttf|otf|ttc)$/i,
|
|
341
|
+
oneOf: [
|
|
342
|
+
/* config.module.rule('font').oneOf('font-asset-url') */
|
|
343
|
+
{
|
|
344
|
+
type: 'asset/resource',
|
|
345
|
+
resourceQuery: /(__inline=false|url)/,
|
|
346
|
+
generator: {
|
|
347
|
+
filename: 'static/font/[name][ext]'
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
/* config.module.rule('font').oneOf('font-asset-inline') */
|
|
351
|
+
{
|
|
352
|
+
type: 'asset/inline',
|
|
353
|
+
resourceQuery: /inline/
|
|
354
|
+
},
|
|
355
|
+
/* config.module.rule('font').oneOf('font-asset') */
|
|
356
|
+
{
|
|
357
|
+
type: 'asset',
|
|
358
|
+
parser: {
|
|
359
|
+
dataUrlCondition: {
|
|
360
|
+
maxSize: 4096
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
generator: {
|
|
364
|
+
filename: 'static/font/[name][ext]'
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
},
|
|
369
|
+
/* config.module.rule('wasm') */
|
|
370
|
+
{
|
|
371
|
+
test: /\.wasm$/,
|
|
372
|
+
dependency: 'url',
|
|
373
|
+
type: 'asset/resource',
|
|
374
|
+
generator: {
|
|
375
|
+
filename: 'static/wasm/[hash].module.wasm'
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
/* config.module.rule('rsbuild-transform-0') */
|
|
379
|
+
{
|
|
380
|
+
test: /\.node$/,
|
|
381
|
+
use: [
|
|
382
|
+
/* config.module.rule('rsbuild-transform-0').use('rsbuild-transform-0') */
|
|
383
|
+
{
|
|
384
|
+
loader: '/Users/bytedance/Documents/codes/path-serializer/node_modules/.pnpm/@rsbuild+core@1.0.1-beta.10/node_modules/@rsbuild/core/dist/transformRawLoader.cjs',
|
|
385
|
+
options: {
|
|
386
|
+
id: 'rsbuild-transform-0',
|
|
387
|
+
getEnvironment: () => environment2
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
},
|
|
394
|
+
optimization: {
|
|
395
|
+
minimize: false,
|
|
396
|
+
splitChunks: false,
|
|
397
|
+
concatenateModules: true,
|
|
398
|
+
moduleIds: 'named'
|
|
399
|
+
},
|
|
400
|
+
plugins: [
|
|
401
|
+
/* config.plugin('RsbuildCorePlugin') */
|
|
402
|
+
new RsbuildCorePlugin(),
|
|
403
|
+
/* config.plugin('define') */
|
|
404
|
+
new DefinePlugin(
|
|
405
|
+
{
|
|
406
|
+
'process.env.NODE_ENV': '"production"',
|
|
407
|
+
'process.env.ASSET_PREFIX': '""'
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
],
|
|
411
|
+
performance: {
|
|
412
|
+
hints: false,
|
|
413
|
+
maxAssetSize: 250000,
|
|
414
|
+
maxEntrypointSize: 250000
|
|
415
|
+
},
|
|
416
|
+
entry: {
|
|
417
|
+
main: [
|
|
418
|
+
'./src/index.ts'
|
|
419
|
+
]
|
|
420
|
+
},
|
|
421
|
+
externalsType: 'module-import'
|
|
422
|
+
}
|