@dtwo/schema 3.0.0-rc.13

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.
@@ -0,0 +1,1221 @@
1
+
2
+
3
+ # `components`
4
+
5
+ # `imports`
6
+
7
+ ## `global`
8
+ - **Type**: `boolean`
9
+ - **Default**: `false`
10
+
11
+
12
+ ## `dirs`
13
+ - **Type**: `array`
14
+ - **Default**: `[]`
15
+
16
+
17
+ # `pages`
18
+ - **Type**: `boolean`
19
+ - **Default**: `undefined`
20
+
21
+ > Whether to use the kdu-router integration in Dtwo 3. If you do not provide a value it will be enabled if you have a `pages/` directory in your source folder.
22
+
23
+
24
+ # `telemetry`
25
+ - **Type**: `boolean`
26
+ - **Default**: `undefined`
27
+
28
+ > Manually disable dtwo telemetry.
29
+
30
+
31
+ # `kdu`
32
+
33
+ ## `compilerOptions`
34
+ - **Type**: `@kdujsCompilerCoreCompilerOptions`
35
+ - **Default**: `{}`
36
+
37
+ > Options for the Kdu compiler that will be passed at build time.
38
+
39
+
40
+ # `app`
41
+
42
+ ## `baseURL`
43
+ - **Type**: `string`
44
+ - **Default**: `"/"`
45
+
46
+ > The base path of your Dtwo application.
47
+
48
+
49
+ This can be set at runtime by setting the DTWO_APP_BASE_URL environment variable.
50
+
51
+
52
+ ## `buildAssetsDir`
53
+ - **Type**: `string`
54
+ - **Default**: `"/_dtwo/"`
55
+
56
+ > The folder name for the built site assets, relative to `baseURL` (or `cdnURL` if set). This is set at build time and should not be customized at runtime.
57
+
58
+
59
+ ## `cdnURL`
60
+ - **Type**: `string`
61
+ - **Default**: `""`
62
+
63
+ > An absolute URL to serve the public folder from (production-only).
64
+
65
+
66
+ This can be set to a different value at runtime by setting the `DTWO_APP_CDN_URL` environment variable.
67
+
68
+
69
+ ## `head`
70
+
71
+ ## `layoutTransition`
72
+ - **Type**: `SrcTypesConfigDtwoAppConfig['layoutTransition']`
73
+ - **Default**: `false`
74
+
75
+ > Default values for layout transitions.
76
+
77
+
78
+ This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
79
+
80
+
81
+ ## `pageTransition`
82
+ - **Type**: `SrcTypesConfigDtwoAppConfig['pageTransition']`
83
+ - **Default**: `false`
84
+
85
+ > Default values for page transitions.
86
+
87
+
88
+ This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
89
+
90
+
91
+ ## `keepalive`
92
+ - **Type**: `SrcTypesConfigDtwoAppConfig['keepalive']`
93
+ - **Default**: `false`
94
+
95
+ > Default values for KeepAlive configuration between pages.
96
+
97
+
98
+ This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
99
+
100
+
101
+ ## `rootId`
102
+ - **Type**: `string`
103
+ - **Default**: `"__dtwo"`
104
+
105
+ > Customize Dtwo root element id.
106
+
107
+
108
+ ## `rootTag`
109
+ - **Type**: `string`
110
+ - **Default**: `"div"`
111
+
112
+ > Customize Dtwo root element tag.
113
+
114
+
115
+ # `plugins`
116
+ - **Type**: `(SrcTypesDtwoDtwoPlugin | string)[]`
117
+ - **Default**: `[]`
118
+
119
+ > An array of dtwo app plugins.
120
+
121
+
122
+ Each plugin can be a string (which can be an absolute or relative path to a file). If it ends with `.client` or `.server` then it will be automatically loaded only in the appropriate context.
123
+ It can also be an object with `src` and `mode` keys.
124
+
125
+
126
+ # `css`
127
+ - **Type**: `string[]`
128
+ - **Default**: `[]`
129
+
130
+ > You can define the CSS files/modules/libraries you want to set globally (included in every page).
131
+
132
+
133
+ Dtwo will automatically guess the file type by its extension and use the appropriate pre-processor. You will still need to install the required loader if you need to use them.
134
+
135
+
136
+ # `builder`
137
+ - **Type**: `'wite' | 'webpack' | { bundle: (dtwo: SrcTypesDtwoDtwo) => Promise<void> }`
138
+ - **Default**: `"@dtwo/wite-builder"`
139
+
140
+ > The builder to use for bundling the Kdu part of your application.
141
+
142
+
143
+ # `sourcemap`
144
+
145
+ # `build`
146
+
147
+ ## `transpile`
148
+ - **Type**: `Array<string | RegExp | Function>`
149
+ - **Default**: `[]`
150
+
151
+ > If you want to transpile specific dependencies with Babel, you can add them here. Each item in transpile can be a package name, a function, a string or regex object matching the dependency's file name.
152
+
153
+
154
+ You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }).
155
+
156
+
157
+ ## `templates`
158
+ - **Type**: `array`
159
+ - **Default**: `[]`
160
+
161
+ > You can provide your own templates which will be rendered based on Dtwo configuration. This feature is specially useful for using with modules.
162
+
163
+
164
+ Templates are rendered using [`lodash.template`](https://lodash.com/docs/4.17.15#template).
165
+
166
+
167
+ ## `analyze`
168
+ - **Type**: `boolean | WebpackBundleAnalyzerBundleAnalyzerPluginOptions | RollupPluginVisualizerPluginVisualizerOptions`
169
+ - **Default**: `false`
170
+
171
+ > Dtwo uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them.
172
+
173
+
174
+ Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for wite](https://github.com/btd/rollup-plugin-visualizer#options).
175
+
176
+
177
+ # `extends`
178
+ - **Type**: `string|string[]`
179
+ - **Default**: `null`
180
+
181
+ > Extend project from multiple local or remote sources.
182
+
183
+
184
+ Value should be either a string or array of strings pointing to source directories or config path relative to current config.
185
+ You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.
186
+
187
+
188
+ # `theme`
189
+ - **Type**: `string`
190
+ - **Default**: `null`
191
+
192
+ > Extend project from a local or remote source.
193
+
194
+
195
+ Value should be a string pointing to source directory or config path relative to current config.
196
+ You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.
197
+
198
+
199
+ # `rootDir`
200
+ - **Type**: `string`
201
+ - **Default**: `"/<rootDir>"`
202
+
203
+ > Define the root directory of your application.
204
+
205
+
206
+ This property can be overwritten (for example, running `dtwo ./my-app/` will set the `rootDir` to the absolute path of `./my-app/` from the current/working directory.
207
+ It is normally not needed to configure this option.
208
+
209
+
210
+ # `workspaceDir`
211
+ - **Type**: `string`
212
+ - **Default**: `"/<rootDir>"`
213
+
214
+ > Define the workspace directory of your application.
215
+
216
+
217
+ Often this is used when in a monorepo setup. Dtwo will attempt to detect your workspace directory automatically, but you can override it here.
218
+ It is normally not needed to configure this option.
219
+
220
+
221
+ # `srcDir`
222
+ - **Type**: `string`
223
+ - **Default**: `"/<rootDir>"`
224
+
225
+ > Define the source directory of your Dtwo application.
226
+
227
+
228
+ If a relative path is specified, it will be relative to the `rootDir`.
229
+
230
+
231
+ # `serverDir`
232
+ - **Type**: `string`
233
+ - **Default**: `"/<rootDir>/server"`
234
+
235
+ > Define the server directory of your Dtwo application, where Hole routes, middleware and plugins are kept.
236
+
237
+
238
+ If a relative path is specified, it will be relative to your `rootDir`.
239
+
240
+
241
+ # `buildDir`
242
+ - **Type**: `string`
243
+ - **Default**: `"/<rootDir>/.dtwo"`
244
+
245
+ > Define the directory where your built Dtwo files will be placed.
246
+
247
+
248
+ Many tools assume that `.dtwo` is a hidden directory (because it starts with a `.`). If that is a problem, you can use this option to prevent that.
249
+
250
+
251
+ # `modulesDir`
252
+ - **Type**: `array`
253
+ - **Default**: `["/<rootDir>/node_modules","D:/Workspace/ORGs/d2js/dtwo/packages/schema/node_modules"]`
254
+
255
+ > Used to set the modules directories for path resolving (for example, webpack's `resolveLoading`, `nodeExternals` and `postcss`).
256
+
257
+
258
+ The configuration path is relative to `options.rootDir` (default is current working directory).
259
+ Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository.
260
+
261
+
262
+ # `dev`
263
+ - **Type**: `boolean`
264
+ - **Default**: `false`
265
+
266
+ > Whether Dtwo is running in development mode.
267
+
268
+
269
+ Normally, you should not need to set this.
270
+
271
+
272
+ # `test`
273
+ - **Type**: `boolean`
274
+ - **Default**: `false`
275
+
276
+ > Whether your app is being unit tested.
277
+
278
+
279
+ # `debug`
280
+ - **Type**: `boolean`
281
+ - **Default**: `false`
282
+
283
+ > Set to `true` to enable debug mode.
284
+
285
+
286
+ At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser.
287
+
288
+
289
+ # `ssr`
290
+ - **Type**: `boolean`
291
+ - **Default**: `true`
292
+
293
+ > Whether to enable rendering of HTML - either dynamically (in server mode) or at generate time. If set to `false` and combined with `static` target, generated pages will simply display a loading screen with no content.
294
+
295
+
296
+ # `modules`
297
+ - **Type**: `(SrcTypesModuleDtwoModule | string | [SrcTypesModuleDtwoModule | string, Record<string, any>])[]`
298
+ - **Default**: `[]`
299
+
300
+ > Modules are Dtwo extensions which can extend its core functionality and add endless integrations.
301
+
302
+
303
+ Each module is either a string (which can refer to a package, or be a path to a file), a tuple with the module as first string and the options as a second object, or an inline module function.
304
+ Dtwo tries to resolve each item in the modules array using node require path (in `node_modules`) and then will be resolved from project `srcDir` if `~` alias is used.
305
+
306
+
307
+ # `dir`
308
+
309
+ ## `assets`
310
+ - **Type**: `string`
311
+ - **Default**: `"assets"`
312
+
313
+ > The assets directory (aliased as `~assets` in your build).
314
+
315
+
316
+ ## `layouts`
317
+ - **Type**: `string`
318
+ - **Default**: `"layouts"`
319
+
320
+ > The layouts directory, each file of which will be auto-registered as a Dtwo layout.
321
+
322
+
323
+ ## `middleware`
324
+ - **Type**: `string`
325
+ - **Default**: `"middleware"`
326
+
327
+ > The middleware directory, each file of which will be auto-registered as a Dtwo middleware.
328
+
329
+
330
+ ## `pages`
331
+ - **Type**: `string`
332
+ - **Default**: `"pages"`
333
+
334
+ > The directory which will be processed to auto-generate your application page routes.
335
+
336
+
337
+ ## `plugins`
338
+ - **Type**: `string`
339
+ - **Default**: `"plugins"`
340
+
341
+ > The plugins directory, each file of which will be auto-registered as a Dtwo plugin.
342
+
343
+
344
+ ## `public`
345
+ - **Type**: `string`
346
+ - **Default**: `"public"`
347
+
348
+ > The directory containing your static files, which will be directly accessible via the Dtwo server and copied across into your `dist` folder when your app is generated.
349
+
350
+
351
+ ## `static`
352
+ - **Type**: `string`
353
+ - **Default**: `"public"`
354
+
355
+
356
+ # `extensions`
357
+ - **Type**: `array`
358
+ - **Default**: `[".js",".jsx",".mjs",".ts",".tsx",".kdu"]`
359
+
360
+ > The extensions that should be resolved by the Dtwo resolver.
361
+
362
+
363
+ # `alias`
364
+
365
+ # `ignoreOptions`
366
+ - **Type**: `any`
367
+ - **Default**: `{}`
368
+
369
+ > Pass options directly to `node-ignore` (which is used by Dtwo to ignore files).
370
+
371
+
372
+ # `ignorePrefix`
373
+ - **Type**: `string`
374
+ - **Default**: `"-"`
375
+
376
+ > Any file in `pages/`, `layouts/`, `middleware/` or `store/` will be ignored during building if its filename starts with the prefix specified by `ignorePrefix`.
377
+
378
+
379
+ # `ignore`
380
+ - **Type**: `array`
381
+ - **Default**: `["**/*.stories.{js,ts,jsx,tsx}","**/*.{spec,test}.{js,ts,jsx,tsx}","**/*.d.ts",".output","**/-*.*"]`
382
+
383
+ > More customizable than `ignorePrefix`: all files matching glob patterns specified inside the `ignore` array will be ignored in building.
384
+
385
+
386
+ # `watchers`
387
+
388
+ ## `rewatchOnRawEvents`
389
+ - **Type**: `any`
390
+ - **Default**: `{}`
391
+
392
+ > An array of event types, which, when received, will cause the watcher to restart.
393
+
394
+
395
+ ## `webpack`
396
+
397
+ ### `aggregateTimeout`
398
+ - **Type**: `number`
399
+ - **Default**: `1000`
400
+
401
+
402
+ ## `chokidar`
403
+
404
+ ### `ignoreInitial`
405
+ - **Type**: `boolean`
406
+ - **Default**: `true`
407
+
408
+
409
+ # `hooks`
410
+ - **Type**: `SrcTypesHooksDtwoHooks`
411
+ - **Default**: `null`
412
+
413
+ > Hooks are listeners to Dtwo events that are typically used in modules, but are also available in `dtwo.config`.
414
+
415
+
416
+ Internally, hooks follow a naming pattern using colons (e.g., build:done).
417
+ For ease of configuration, you can also structure them as an hierarchical object in `dtwo.config` (as below).
418
+
419
+
420
+ # `runtimeConfig`
421
+
422
+ # `appConfig`
423
+ - **Type**: `SrcTypesConfigAppConfig`
424
+ - **Default**: `{}`
425
+
426
+ > Additional app configuration
427
+
428
+
429
+ For programmatic usage and type support, you can directly provide app config with this option. It will be merged with `app.config` file as default value.
430
+
431
+
432
+ # `devServer`
433
+
434
+ ## `https`
435
+ - **Type**: `false | { key: string; cert: string }`
436
+ - **Default**: `false`
437
+
438
+ > Whether to enable HTTPS.
439
+
440
+
441
+ ## `port`
442
+ - **Type**: `number`
443
+ - **Default**: `3000`
444
+
445
+ > Dev server listening port
446
+
447
+
448
+ ## `host`
449
+ - **Type**: `string`
450
+ - **Default**: `"localhost"`
451
+
452
+ > Dev server listening host
453
+
454
+
455
+ ## `url`
456
+ - **Type**: `string`
457
+ - **Default**: `"http://localhost:3000"`
458
+
459
+ > Listening dev server url
460
+
461
+
462
+ # `experimental`
463
+
464
+ ## `asyncEntry`
465
+ - **Type**: `boolean`
466
+ - **Default**: `false`
467
+
468
+ > Set to true to generate an async entry point for the Kdu bundle (for module federation support).
469
+
470
+
471
+ ## `reactivityTransform`
472
+ - **Type**: `boolean`
473
+ - **Default**: `false`
474
+
475
+ > Enable Kdu's reactivity transform
476
+
477
+
478
+ ## `externalKdu`
479
+ - **Type**: `boolean`
480
+ - **Default**: `true`
481
+
482
+ > Externalize `kdu`, `@kdujs/*` and `kdu-router` when building.
483
+
484
+
485
+ ## `treeshakeClientOnly`
486
+ - **Type**: `boolean`
487
+ - **Default**: `true`
488
+
489
+ > Tree shakes contents of client-only components from server bundle.
490
+
491
+
492
+ ## `witeNode`
493
+ - **Type**: `boolean`
494
+ - **Default**: `true`
495
+
496
+ > Use wite-node for on-demand server chunk loading
497
+
498
+
499
+ ## `witeServerDynamicImports`
500
+ - **Type**: `boolean`
501
+ - **Default**: `true`
502
+
503
+ > Split server bundle into multiple chunks and dynamically import them.
504
+
505
+
506
+ ## `inlineSSRStyles`
507
+ - **Type**: `boolean | ((id?: string) => boolean)`
508
+ - **Default**: `true`
509
+
510
+ > Inline styles when rendering HTML (currently wite only).
511
+
512
+
513
+ You can also pass a function that receives the path of a Kdu component and returns a boolean indicating whether to inline the styles for that component.
514
+
515
+
516
+ ## `noScripts`
517
+ - **Type**: `boolean`
518
+ - **Default**: `false`
519
+
520
+ > Turn off rendering of Dtwo scripts and JS resource hints.
521
+
522
+
523
+ ## `payloadExtraction`
524
+ - **Type**: `boolean`
525
+ - **Default**: `false`
526
+
527
+ > When this option is enabled (by default) payload of pages generated with `dtwo generate` are extracted
528
+
529
+
530
+ ## `crossOriginPrefetch`
531
+ - **Type**: `boolean`
532
+ - **Default**: `false`
533
+
534
+ > Enable cross-origin prefetch using the Speculation Rules API.
535
+
536
+
537
+ ## `writeEarlyHints`
538
+ - **Type**: `boolean`
539
+ - **Default**: `false`
540
+
541
+ > Write early hints when using node server.
542
+
543
+
544
+ # `generate`
545
+
546
+ ## `routes`
547
+ - **Type**: `array`
548
+ - **Default**: `[]`
549
+
550
+ > The routes to generate.
551
+
552
+
553
+ If you are using the crawler, this will be only the starting point for route generation. This is often necessary when using dynamic routes.
554
+ It can be an array or a function.
555
+
556
+
557
+ ## `exclude`
558
+ - **Type**: `array`
559
+ - **Default**: `[]`
560
+
561
+ > An array of string or regular expressions that will prevent generation of routes matching them. The routes will still be accessible when `fallback` is set.
562
+
563
+
564
+ # `_majorVersion`
565
+ - **Type**: `number`
566
+ - **Default**: `3`
567
+
568
+
569
+ # `_legacyGenerate`
570
+ - **Type**: `boolean`
571
+ - **Default**: `false`
572
+
573
+
574
+ # `_start`
575
+ - **Type**: `boolean`
576
+ - **Default**: `false`
577
+
578
+
579
+ # `_build`
580
+ - **Type**: `boolean`
581
+ - **Default**: `false`
582
+
583
+
584
+ # `_generate`
585
+ - **Type**: `boolean`
586
+ - **Default**: `false`
587
+
588
+
589
+ # `_prepare`
590
+ - **Type**: `boolean`
591
+ - **Default**: `false`
592
+
593
+
594
+ # `_cli`
595
+ - **Type**: `boolean`
596
+ - **Default**: `false`
597
+
598
+
599
+ # `_requiredModules`
600
+ - **Type**: `any`
601
+ - **Default**: `{}`
602
+
603
+
604
+ # `_dtwoConfigFile`
605
+ - **Type**: `any`
606
+ - **Default**: `{}`
607
+
608
+
609
+ # `_dtwoConfigFiles`
610
+ - **Type**: `array`
611
+ - **Default**: `[]`
612
+
613
+
614
+ # `appDir`
615
+ - **Type**: `string`
616
+ - **Default**: `""`
617
+
618
+
619
+ # `_installedModules`
620
+ - **Type**: `array`
621
+ - **Default**: `[]`
622
+
623
+
624
+ # `_modules`
625
+ - **Type**: `array`
626
+ - **Default**: `[]`
627
+
628
+
629
+ # `hole`
630
+
631
+ ## `routeRules`
632
+
633
+ # `routeRules`
634
+ - **Type**: `HolepackHoleConfig['routeRules']`
635
+ - **Default**: `{}`
636
+
637
+ > Global route options applied to matching server routes.
638
+
639
+
640
+ # `serverHandlers`
641
+ - **Type**: `HolepackHoleEventHandler[]`
642
+ - **Default**: `[]`
643
+
644
+ > Hole server handlers.
645
+
646
+
647
+ Each handler accepts the following options: - handler: The path to the file defining the handler. - route: The route under which the handler is available. This follows the conventions of https://github.com/unjs/radix3. - method: The HTTP method of requests that should be handled. - middleware: Specifies whether it is a middleware handler. - lazy: Specifies whether to use lazy loading to import the handler.
648
+
649
+
650
+ # `devServerHandlers`
651
+ - **Type**: `HolepackHoleDevEventHandler[]`
652
+ - **Default**: `[]`
653
+
654
+ > Hole development-only server handlers.
655
+
656
+
657
+ # `postcss`
658
+
659
+ ## `config`
660
+ - **Type**: `boolean`
661
+ - **Default**: `false`
662
+
663
+ > Path to postcss config file.
664
+
665
+
666
+ ## `plugins`
667
+
668
+ ### `postcss-import`
669
+
670
+ ### `postcss-url`
671
+ - **Type**: `any`
672
+ - **Default**: `{}`
673
+
674
+ > https://github.com/postcss/postcss-url
675
+
676
+
677
+ ### `autoprefixer`
678
+ - **Type**: `any`
679
+ - **Default**: `{}`
680
+
681
+ > https://github.com/postcss/autoprefixer
682
+
683
+
684
+ ### `cssnano`
685
+ - **Type**: `boolean`
686
+ - **Default**: `true`
687
+
688
+
689
+ # `router`
690
+
691
+ ## `options`
692
+ - **Type**: `SrcTypesRouterRouterConfigSerializable`
693
+ - **Default**: `{}`
694
+
695
+ > Additional options passed to `kdu-router`.
696
+
697
+
698
+ Note: Only JSON serializable options should be passed by dtwo config.
699
+ For more control, you can use `app/router.options.ts` file.
700
+
701
+
702
+ # `typescript`
703
+
704
+ ## `strict`
705
+ - **Type**: `boolean`
706
+ - **Default**: `true`
707
+
708
+ > TypeScript comes with certain checks to give you more safety and analysis of your program. Once you’ve converted your codebase to TypeScript, you can start enabling these checks for greater safety. [Read More](https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#getting-stricter-checks)
709
+
710
+
711
+ ## `includeWorkspace`
712
+ - **Type**: `boolean`
713
+ - **Default**: `false`
714
+
715
+ > Include parent workspace in the Dtwo project. Mostly useful for themes and module authors.
716
+
717
+
718
+ ## `typeCheck`
719
+ - **Type**: `boolean | 'build'`
720
+ - **Default**: `false`
721
+
722
+ > Enable build-time type checking.
723
+
724
+
725
+ If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. Requires to install `typescript` and `kdu-tsc` as dev dependencies.
726
+
727
+
728
+ ## `tsConfig`
729
+ - **Type**: `PkgTypesReadPackageJSON`
730
+ - **Default**: `{}`
731
+
732
+ > You can extend generated `.dtwo/tsconfig.json` using this option.
733
+
734
+
735
+ ## `shim`
736
+ - **Type**: `boolean`
737
+ - **Default**: `true`
738
+
739
+ > Generate a `*.kdu` shim.
740
+
741
+
742
+ We recommend instead either enabling [**Take Over Mode**](https://kdu-js.web.app/guide/typescript/overview.html#kocan-takeover-mode) or adding TypeScript Kdu Plugin (Kocan)** 👉 [[Download](https://marketplace.visualstudio.com/items?itemName=Kdu-Code.vscode-typescript-kdu-plugin)].
743
+
744
+
745
+ # `wite`
746
+
747
+ ## `root`
748
+ - **Type**: `string`
749
+ - **Default**: `"/<rootDir>"`
750
+
751
+
752
+ ## `mode`
753
+ - **Type**: `string`
754
+ - **Default**: `"production"`
755
+
756
+
757
+ ## `logLevel`
758
+ - **Type**: `string`
759
+ - **Default**: `"warn"`
760
+
761
+
762
+ ## `define`
763
+
764
+ ## `resolve`
765
+
766
+ ### `extensions`
767
+ - **Type**: `array`
768
+ - **Default**: `[".mjs",".js",".ts",".jsx",".tsx",".json",".kdu"]`
769
+
770
+
771
+ ## `publicDir`
772
+ - **Type**: `string`
773
+ - **Default**: `"/<rootDir>/public"`
774
+
775
+
776
+ ## `kdu`
777
+
778
+ ### `isProduction`
779
+ - **Type**: `boolean`
780
+ - **Default**: `true`
781
+
782
+
783
+ ### `template`
784
+
785
+ #### `compilerOptions`
786
+
787
+ ## `optimizeDeps`
788
+
789
+ ### `exclude`
790
+ - **Type**: `array`
791
+ - **Default**: `["kdu-demi"]`
792
+
793
+
794
+ ## `esbuild`
795
+
796
+ ### `jsxFactory`
797
+ - **Type**: `string`
798
+ - **Default**: `"h"`
799
+
800
+
801
+ ### `jsxFragment`
802
+ - **Type**: `string`
803
+ - **Default**: `"Fragment"`
804
+
805
+
806
+ ### `tsconfigRaw`
807
+ - **Type**: `string`
808
+ - **Default**: `"{}"`
809
+
810
+
811
+ ## `clearScreen`
812
+ - **Type**: `boolean`
813
+ - **Default**: `false`
814
+
815
+
816
+ ## `build`
817
+
818
+ ### `assetsDir`
819
+ - **Type**: `string`
820
+ - **Default**: `"_dtwo/"`
821
+
822
+
823
+ ### `emptyOutDir`
824
+ - **Type**: `boolean`
825
+ - **Default**: `false`
826
+
827
+
828
+ ## `server`
829
+
830
+ ### `fs`
831
+
832
+ #### `allow`
833
+ - **Type**: `array`
834
+ - **Default**: `["/<rootDir>/.dtwo","/<rootDir>","/<rootDir>","/<rootDir>","/<rootDir>/node_modules","D:/Workspace/ORGs/d2js/dtwo/packages/schema/node_modules"]`
835
+
836
+
837
+ # `webpack`
838
+
839
+ ## `analyze`
840
+ - **Type**: `boolean | WebpackBundleAnalyzerBundleAnalyzerPluginOptions`
841
+ - **Default**: `false`
842
+
843
+ > Dtwo uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them.
844
+
845
+
846
+ Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for wite](https://github.com/btd/rollup-plugin-visualizer#options).
847
+
848
+
849
+ ## `profile`
850
+ - **Type**: `boolean`
851
+ - **Default**: `false`
852
+
853
+ > Enable the profiler in webpackbar.
854
+
855
+
856
+ It is normally enabled by CLI argument `--profile`.
857
+
858
+
859
+ ## `extractCSS`
860
+ - **Type**: `boolean | MiniCssExtractPluginPluginOptions`
861
+ - **Default**: `true`
862
+
863
+ > Enables Common CSS Extraction using [Kdu Server Renderer guidelines](https://kdujs-ssr.web.app/guide/css.html).
864
+
865
+
866
+ Using [extract-css-chunks-webpack-plugin](https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/) under the hood, your CSS will be extracted into separate files, usually one per component. This allows caching your CSS and JavaScript separately and is worth trying if you have a lot of global or shared CSS.
867
+
868
+
869
+ ## `cssSourceMap`
870
+ - **Type**: `boolean`
871
+ - **Default**: `false`
872
+
873
+ > Enables CSS source map support (defaults to `true` in development).
874
+
875
+
876
+ ## `serverURLPolyfill`
877
+ - **Type**: `string`
878
+ - **Default**: `"url"`
879
+
880
+ > The polyfill library to load to provide URL and URLSearchParams.
881
+
882
+
883
+ Defaults to `'url'` ([see package](https://www.npmjs.com/package/url)).
884
+
885
+
886
+ ## `filenames`
887
+
888
+ ### `app`
889
+ - **Type**: `function`
890
+ - **Default**: `undefined`
891
+
892
+ ```ts
893
+ () => any
894
+ ```
895
+
896
+
897
+ ### `chunk`
898
+ - **Type**: `function`
899
+ - **Default**: `undefined`
900
+
901
+ ```ts
902
+ () => any
903
+ ```
904
+
905
+
906
+ ### `css`
907
+ - **Type**: `function`
908
+ - **Default**: `undefined`
909
+
910
+ ```ts
911
+ () => any
912
+ ```
913
+
914
+
915
+ ### `img`
916
+ - **Type**: `function`
917
+ - **Default**: `undefined`
918
+
919
+ ```ts
920
+ () => any
921
+ ```
922
+
923
+
924
+ ### `font`
925
+ - **Type**: `function`
926
+ - **Default**: `undefined`
927
+
928
+ ```ts
929
+ () => any
930
+ ```
931
+
932
+
933
+ ### `video`
934
+ - **Type**: `function`
935
+ - **Default**: `undefined`
936
+
937
+ ```ts
938
+ () => any
939
+ ```
940
+
941
+
942
+ ## `loaders`
943
+
944
+ ### `file`
945
+
946
+ #### `esModule`
947
+ - **Type**: `boolean`
948
+ - **Default**: `false`
949
+
950
+
951
+ ### `fontUrl`
952
+
953
+ #### `esModule`
954
+ - **Type**: `boolean`
955
+ - **Default**: `false`
956
+
957
+
958
+ #### `limit`
959
+ - **Type**: `number`
960
+ - **Default**: `1000`
961
+
962
+
963
+ ### `imgUrl`
964
+
965
+ #### `esModule`
966
+ - **Type**: `boolean`
967
+ - **Default**: `false`
968
+
969
+
970
+ #### `limit`
971
+ - **Type**: `number`
972
+ - **Default**: `1000`
973
+
974
+
975
+ ### `pugPlain`
976
+ - **Type**: `any`
977
+ - **Default**: `{}`
978
+
979
+
980
+ ### `kdu`
981
+
982
+ #### `productionMode`
983
+ - **Type**: `boolean`
984
+ - **Default**: `true`
985
+
986
+
987
+ #### `transformAssetUrls`
988
+
989
+ ##### `video`
990
+ - **Type**: `string`
991
+ - **Default**: `"src"`
992
+
993
+
994
+ ##### `source`
995
+ - **Type**: `string`
996
+ - **Default**: `"src"`
997
+
998
+
999
+ ##### `object`
1000
+ - **Type**: `string`
1001
+ - **Default**: `"src"`
1002
+
1003
+
1004
+ ##### `embed`
1005
+ - **Type**: `string`
1006
+ - **Default**: `"src"`
1007
+
1008
+
1009
+ #### `compilerOptions`
1010
+
1011
+ ### `css`
1012
+
1013
+ #### `importLoaders`
1014
+ - **Type**: `number`
1015
+ - **Default**: `0`
1016
+
1017
+
1018
+ #### `url`
1019
+
1020
+ ##### `filter`
1021
+ - **Type**: `function`
1022
+ - **Default**: `undefined`
1023
+
1024
+ ```ts
1025
+ () => any
1026
+ ```
1027
+
1028
+
1029
+ #### `esModule`
1030
+ - **Type**: `boolean`
1031
+ - **Default**: `false`
1032
+
1033
+
1034
+ ### `cssModules`
1035
+
1036
+ #### `importLoaders`
1037
+ - **Type**: `number`
1038
+ - **Default**: `0`
1039
+
1040
+
1041
+ #### `url`
1042
+
1043
+ ##### `filter`
1044
+ - **Type**: `function`
1045
+ - **Default**: `undefined`
1046
+
1047
+ ```ts
1048
+ () => any
1049
+ ```
1050
+
1051
+
1052
+ #### `esModule`
1053
+ - **Type**: `boolean`
1054
+ - **Default**: `false`
1055
+
1056
+
1057
+ #### `modules`
1058
+
1059
+ ##### `localIdentName`
1060
+ - **Type**: `string`
1061
+ - **Default**: `"[local]_[hash:base64:5]"`
1062
+
1063
+
1064
+ ### `less`
1065
+ - **Type**: `any`
1066
+ - **Default**: `{"sourceMap":false}`
1067
+
1068
+
1069
+ ### `sass`
1070
+
1071
+ #### `sassOptions`
1072
+
1073
+ ##### `indentedSyntax`
1074
+ - **Type**: `boolean`
1075
+ - **Default**: `true`
1076
+
1077
+
1078
+ ### `scss`
1079
+ - **Type**: `any`
1080
+ - **Default**: `{"sourceMap":false}`
1081
+
1082
+
1083
+ ### `stylus`
1084
+ - **Type**: `any`
1085
+ - **Default**: `{"sourceMap":false}`
1086
+
1087
+
1088
+ ### `kduStyle`
1089
+ - **Type**: `any`
1090
+ - **Default**: `{"sourceMap":false}`
1091
+
1092
+
1093
+ ## `plugins`
1094
+ - **Type**: `array`
1095
+ - **Default**: `[]`
1096
+
1097
+ > Add webpack plugins.
1098
+
1099
+
1100
+ ## `terser`
1101
+ - **Type**: `false | TerserWebpackPluginBasePluginOptions & TerserWebpackPluginDefinedDefaultMinimizerAndOptions<any>`
1102
+ - **Default**: `{}`
1103
+
1104
+ > Terser plugin options.
1105
+
1106
+
1107
+ Set to false to disable this plugin, or pass an object of options.
1108
+
1109
+
1110
+ ## `aggressiveCodeRemoval`
1111
+ - **Type**: `boolean`
1112
+ - **Default**: `false`
1113
+
1114
+ > Hard-replaces `typeof process`, `typeof window` and `typeof document` to tree-shake bundle.
1115
+
1116
+
1117
+ ## `optimizeCSS`
1118
+ - **Type**: `false | CssMinimizerWebpackPluginBasePluginOptions & CssMinimizerWebpackPluginDefinedDefaultMinimizerAndOptions<any>`
1119
+ - **Default**: `false`
1120
+
1121
+ > OptimizeCSSAssets plugin options.
1122
+
1123
+
1124
+ Defaults to true when `extractCSS` is enabled.
1125
+
1126
+
1127
+ ## `optimization`
1128
+
1129
+ ### `runtimeChunk`
1130
+ - **Type**: `string`
1131
+ - **Default**: `"single"`
1132
+
1133
+
1134
+ ### `minimize`
1135
+ - **Type**: `boolean`
1136
+ - **Default**: `true`
1137
+
1138
+ > Set minimize to `false` to disable all minimizers. (It is disabled in development by default).
1139
+
1140
+
1141
+ ### `minimizer`
1142
+ - **Type**: `any`
1143
+ - **Default**: `{}`
1144
+
1145
+ > You can set minimizer to a customized array of plugins.
1146
+
1147
+
1148
+ ### `splitChunks`
1149
+
1150
+ #### `chunks`
1151
+ - **Type**: `string`
1152
+ - **Default**: `"all"`
1153
+
1154
+
1155
+ #### `automaticNameDelimiter`
1156
+ - **Type**: `string`
1157
+ - **Default**: `"/"`
1158
+
1159
+
1160
+ #### `cacheGroups`
1161
+ - **Type**: `any`
1162
+ - **Default**: `{}`
1163
+
1164
+
1165
+ ## `postcss`
1166
+
1167
+ ### `execute`
1168
+ - **Type**: `undefined`
1169
+ - **Default**: `undefined`
1170
+
1171
+
1172
+ ### `postcssOptions`
1173
+
1174
+ #### `config`
1175
+ - **Type**: `boolean`
1176
+ - **Default**: `false`
1177
+
1178
+
1179
+ #### `plugins`
1180
+
1181
+ ### `sourceMap`
1182
+ - **Type**: `undefined`
1183
+ - **Default**: `undefined`
1184
+
1185
+
1186
+ ### `implementation`
1187
+ - **Type**: `undefined`
1188
+ - **Default**: `undefined`
1189
+
1190
+
1191
+ ### `order`
1192
+ - **Type**: `string`
1193
+ - **Default**: `""`
1194
+
1195
+
1196
+ ## `devMiddleware`
1197
+
1198
+ ### `stats`
1199
+ - **Type**: `string`
1200
+ - **Default**: `"none"`
1201
+
1202
+
1203
+ ## `hotMiddleware`
1204
+ - **Type**: `WebpackHotMiddlewareMiddlewareOptions & { client?: WebpackHotMiddlewareClientOptions }`
1205
+ - **Default**: `{}`
1206
+
1207
+ > See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options.
1208
+
1209
+
1210
+ ## `friendlyErrors`
1211
+ - **Type**: `boolean`
1212
+ - **Default**: `true`
1213
+
1214
+ > Set to `false` to disable the overlay provided by [FriendlyErrorsWebpackPlugin](https://www.npmjs.com/package/@d2js/friendly-errors-webpack-plugin).
1215
+
1216
+
1217
+ ## `warningIgnoreFilters`
1218
+ - **Type**: `Array<(warn: WebpackWebpackError) => boolean>`
1219
+ - **Default**: `[]`
1220
+
1221
+ > Filters to hide build warnings.