@razerspine/build 1.0.0

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.
Files changed (80) hide show
  1. package/CHANGELOG.md +750 -0
  2. package/LICENSE +15 -0
  3. package/README.md +232 -0
  4. package/dist/core/config-meta.d.ts +33 -0
  5. package/dist/core/config-meta.js +27 -0
  6. package/dist/core/create-base-config.d.ts +52 -0
  7. package/dist/core/create-base-config.js +180 -0
  8. package/dist/core/create-dev-config.d.ts +18 -0
  9. package/dist/core/create-dev-config.js +68 -0
  10. package/dist/core/create-prod-config.d.ts +12 -0
  11. package/dist/core/create-prod-config.js +56 -0
  12. package/dist/core/define-config.d.ts +67 -0
  13. package/dist/core/define-config.js +81 -0
  14. package/dist/core/index.d.ts +5 -0
  15. package/dist/core/index.js +14 -0
  16. package/dist/hosting/detect-hosting.d.ts +2 -0
  17. package/dist/hosting/detect-hosting.js +14 -0
  18. package/dist/hosting/get-redirects.d.ts +2 -0
  19. package/dist/hosting/get-redirects.js +8 -0
  20. package/dist/hosting/get-vercel-config.d.ts +2 -0
  21. package/dist/hosting/get-vercel-config.js +22 -0
  22. package/dist/index.d.ts +4 -0
  23. package/dist/index.js +27 -0
  24. package/dist/options/index.d.ts +2 -0
  25. package/dist/options/index.js +5 -0
  26. package/dist/options/normalize-options.d.ts +14 -0
  27. package/dist/options/normalize-options.js +38 -0
  28. package/dist/options/resolve-options.d.ts +3 -0
  29. package/dist/options/resolve-options.js +9 -0
  30. package/dist/options/validate-options.d.ts +2 -0
  31. package/dist/options/validate-options.js +28 -0
  32. package/dist/plugins/hosting-routing-plugin.d.ts +12 -0
  33. package/dist/plugins/hosting-routing-plugin.js +54 -0
  34. package/dist/plugins/html-templates-plugin.d.ts +16 -0
  35. package/dist/plugins/html-templates-plugin.js +82 -0
  36. package/dist/plugins/pug-templates-plugin.d.ts +16 -0
  37. package/dist/plugins/pug-templates-plugin.js +90 -0
  38. package/dist/presets/react/index.d.ts +1 -0
  39. package/dist/presets/react/index.js +5 -0
  40. package/dist/presets/react/react-preset.d.ts +66 -0
  41. package/dist/presets/react/react-preset.js +198 -0
  42. package/dist/rules/assets-rule.d.ts +27 -0
  43. package/dist/rules/assets-rule.js +32 -0
  44. package/dist/rules/index.d.ts +4 -0
  45. package/dist/rules/index.js +11 -0
  46. package/dist/rules/pug-rule.d.ts +16 -0
  47. package/dist/rules/pug-rule.js +27 -0
  48. package/dist/rules/scripts-rule.d.ts +15 -0
  49. package/dist/rules/scripts-rule.js +22 -0
  50. package/dist/rules/styles-rule.d.ts +21 -0
  51. package/dist/rules/styles-rule.js +28 -0
  52. package/dist/types/app-type.d.ts +1 -0
  53. package/dist/types/app-type.js +2 -0
  54. package/dist/types/base-webpack-config-type.d.ts +2 -0
  55. package/dist/types/base-webpack-config-type.js +2 -0
  56. package/dist/types/build-plugin-type.d.ts +24 -0
  57. package/dist/types/build-plugin-type.js +2 -0
  58. package/dist/types/config-option-type.d.ts +120 -0
  59. package/dist/types/config-option-type.js +2 -0
  60. package/dist/types/hosting-type.d.ts +1 -0
  61. package/dist/types/hosting-type.js +2 -0
  62. package/dist/types/index.d.ts +9 -0
  63. package/dist/types/index.js +2 -0
  64. package/dist/types/mode-type.d.ts +1 -0
  65. package/dist/types/mode-type.js +2 -0
  66. package/dist/types/script-type.d.ts +1 -0
  67. package/dist/types/script-type.js +2 -0
  68. package/dist/types/style-type.d.ts +1 -0
  69. package/dist/types/style-type.js +2 -0
  70. package/dist/types/templates-type.d.ts +1 -0
  71. package/dist/types/templates-type.js +2 -0
  72. package/dist/utils/dedupe-plugins.d.ts +5 -0
  73. package/dist/utils/dedupe-plugins.js +20 -0
  74. package/dist/utils/dedupe-rules.d.ts +9 -0
  75. package/dist/utils/dedupe-rules.js +27 -0
  76. package/dist/utils/index.d.ts +3 -0
  77. package/dist/utils/index.js +9 -0
  78. package/dist/utils/text-capitalize.d.ts +1 -0
  79. package/dist/utils/text-capitalize.js +6 -0
  80. package/package.json +91 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,750 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ---
6
+
7
+ ## [1.0.0] - 2026-03-20
8
+
9
+ ### 🚨 Breaking Changes
10
+
11
+ - Package renamed from `@razerspine/webpack-core` → `@razerspine/build`
12
+ - The internal architecture has been completely redesigned (breaking changes included)
13
+
14
+ ---
15
+
16
+ ### Major Features
17
+
18
+ #### New Architecture
19
+
20
+ Complete internal restructuring with clear modular boundaries:
21
+
22
+ ```text
23
+ core/ → config creation (base/dev/prod)
24
+ options/ → validation, normalization, resolving
25
+ rules/ → webpack module rules (scripts, styles, assets, pug)
26
+ plugins/ → custom webpack plugins
27
+ hosting/ → hosting detection + routing generation
28
+ presets/ → (Beta) built-in framework setups (React)
29
+ types/ → strongly typed public API
30
+ utils/ → shared helpers
31
+ ```
32
+
33
+ - Improved maintainability and scalability
34
+ - Clear separation of concerns
35
+ - Easier extension for future features
36
+
37
+ ---
38
+
39
+ #### Options Pipeline (validate → normalize → resolve)
40
+
41
+ New unified options processing flow:
42
+
43
+ ```ts
44
+ resolveOptions(options)
45
+ ```
46
+
47
+ - `validateOptions` - strict validation
48
+ - `normalizeOptions` - defaults + shaping
49
+ - `resolveOptions` - single entry point
50
+
51
+ ---
52
+
53
+ #### Config Metadata System
54
+
55
+ Introduced internal metadata layer using WeakMap:
56
+
57
+ ```ts
58
+ setConfigMeta(config, meta)
59
+ getConfigMeta(config)
60
+ ```
61
+
62
+ - Enables context-aware config behavior
63
+ - Used internally for SPA/MPA handling
64
+ - No mutation of webpack config object
65
+
66
+ ---
67
+
68
+ #### defineConfig Helper
69
+
70
+ Introduced a new `defineConfig` helper for creating Webpack configurations.
71
+
72
+ Provides a clean, scalable, and flexible way to define build setup
73
+ without manually composing base/dev/prod configs.
74
+
75
+ ##### Features:
76
+
77
+ - Single entry point for configuration
78
+ - Automatic mode-based resolution (`development` / `production`)
79
+ - Supports static, dynamic, and async config
80
+ - Built-in `presets` support (mapped to `buildPlugins`)
81
+ - Strong typing and improved developer experience
82
+ - Fully compatible with Build Plugins system
83
+
84
+ ##### Supported formats:
85
+
86
+ ```ts
87
+ // Static config
88
+ export default defineConfig({
89
+ mode: 'development',
90
+ scripts: 'ts',
91
+ styles: 'scss'
92
+ });
93
+
94
+ // Dynamic config
95
+ export default defineConfig(({mode}) => ({
96
+ mode,
97
+ scripts: 'ts',
98
+ styles: 'scss'
99
+ }));
100
+
101
+ // Async config
102
+
103
+ export default defineConfig(async ({mode}) => {
104
+ return {
105
+ mode,
106
+ scripts: 'ts',
107
+ styles: 'scss'
108
+ };
109
+ });
110
+
111
+ // Presets support:
112
+ import {defineConfig, reactPreset} from '@razerspine/build';
113
+
114
+ export default defineConfig({
115
+ mode: 'development',
116
+ scripts: 'ts',
117
+ styles: 'scss',
118
+ presets: [
119
+ reactPreset()
120
+ ]
121
+ });
122
+ ```
123
+
124
+ ##### Notes:
125
+
126
+ Internally composes:
127
+
128
+ - `createBaseConfig`
129
+ - `createDevConfig`
130
+ - `createProdConfig`
131
+ - `presets` is syntactic sugar over `buildPlugins`
132
+ - No hidden behavior — all logic delegated to core modules
133
+
134
+ ---
135
+
136
+ #### Template Engine System
137
+
138
+ Introduced flexible template engine support:
139
+
140
+ - `templates.type` option:
141
+ - `pug` (default) → uses `PugTemplatesPlugin`
142
+ - `html` → uses `HtmlTemplatesPlugin`
143
+ - `none` → disables template handling
144
+
145
+ - New plugin:
146
+ - `HtmlTemplatesPlugin` (wrapper around html-webpack-plugin)
147
+
148
+ - Conditional rule injection:
149
+ - `pugRule` is only applied when `templates.type === 'pug'`
150
+
151
+ ---
152
+
153
+ #### React Preset (Beta)
154
+
155
+ Introduced experimental **React preset** built on top of the Build Plugins system.
156
+
157
+ Provides a near Vite-like developer experience for React applications.
158
+
159
+ ##### Features:
160
+
161
+ - Babel-based pipeline (no `ts-loader`)
162
+ - React Fast Refresh (development only)
163
+ - Automatic JSX runtime (`react/jsx-runtime`)
164
+ - TypeScript support (`.ts` / `.tsx`)
165
+ - Zero-config entry (`src/main.tsx` or `src/main.jsx`)
166
+ - Seamless integration with existing rules/plugins system
167
+ - Safe rule & plugin deduplication
168
+
169
+ ##### Usage:
170
+
171
+ ```ts
172
+ import {createBaseConfig, reactPreset} from '@razerspine/build';
173
+
174
+ createBaseConfig({
175
+ mode: 'development',
176
+ scripts: 'ts',
177
+ styles: 'scss',
178
+ templates: {
179
+ type: 'none'
180
+ },
181
+ buildPlugins: [
182
+ reactPreset()
183
+ ]
184
+ });
185
+ ```
186
+
187
+ ##### Required dependencies (must be installed in the user project):
188
+
189
+ ```bash
190
+ npm install -D \
191
+ babel-loader \
192
+ @babel/core \
193
+ @babel/preset-env \
194
+ @babel/preset-react \
195
+ @babel/preset-typescript \
196
+ @pmmmwh/react-refresh-webpack-plugin \
197
+ react-refresh
198
+ ```
199
+
200
+ ##### Notes:
201
+
202
+ - This preset is currently in beta and may evolve.
203
+ - Dependencies are not bundled inside `@razerspine/build` (by design).
204
+ - Missing dependencies will not crash the build, but may degrade DX (e.g. no Fast Refresh).
205
+
206
+ ---
207
+
208
+ #### Rules & Plugins Control
209
+
210
+ Added controlled extension system:
211
+
212
+ ```text
213
+ rules: {
214
+ extend?: RuleSetRule[]
215
+ override?: RuleSetRule[]
216
+ }
217
+
218
+ plugins: {
219
+ extend?: WebpackPluginInstance[]
220
+ override?: WebpackPluginInstance[]
221
+ }
222
+ ```
223
+
224
+ - Safe extension via `extend`
225
+ - Full override via `override` (advanced usage)
226
+
227
+ ---
228
+
229
+ #### Build Plugins System (Lifecycle Hooks)
230
+
231
+ Introduced a new internal plugin system for extending the build pipeline:
232
+
233
+ ```ts
234
+ buildPlugins: [
235
+ {
236
+ setup(ctx) {
237
+ },
238
+ applyBase(config) {
239
+ },
240
+ applyDev(config) {
241
+ },
242
+ applyProd(config) {
243
+ }
244
+ }
245
+ ]
246
+ ```
247
+
248
+ ##### Lifecycle stages:
249
+
250
+ - `setup` → runs before config creation (options preparation)
251
+ - `applyBase` → extends base config
252
+ - `applyDev` → runs only for development config
253
+ - `applyProd` → runs only for production config
254
+
255
+ ##### Key benefits:
256
+
257
+ - Full control over config lifecycle without mutating core logic
258
+ - Clean separation between core and extensions
259
+ - Enables framework-level extensibility
260
+
261
+ ##### Stability guarantees:
262
+
263
+ - Automatic plugin deduplication prevents conflicts and double execution
264
+ - Safe integration with existing `plugins.extend` / `override` APIs
265
+ - No direct mutation of Webpack config metadata (uses WeakMap)
266
+
267
+ ---
268
+
269
+ #### Hosting Integration
270
+
271
+ - Automatic hosting detection
272
+ - Built-in support for:
273
+ - Vercel (`vercel.json`)
274
+ - Static hosting (SPA fallback)
275
+ - Modules:
276
+ - `detect-hosting`
277
+ - `get-vercel-config`
278
+ - `get-redirects`
279
+
280
+ ---
281
+
282
+ New Plugin System
283
+
284
+ - `HostingRoutingPlugin`
285
+ - `PugTemplatesPlugin`
286
+
287
+ Improved:
288
+
289
+ - plugin lifecycle handling
290
+ - better separation from config logic
291
+
292
+ ---
293
+
294
+ #### Testing
295
+
296
+ Massively improved test coverage and quality:
297
+
298
+ ##### Added:
299
+
300
+ - ✅ Unit tests (core, options, hosting, plugins)
301
+ - ✅ Integration tests (config behavior)
302
+ - ✅ E2E tests (real webpack builds with fixtures)
303
+ - ✅ Snapshot tests (config structure regression protection)
304
+
305
+ ##### Test structure:
306
+
307
+ ```text
308
+ unit/
309
+ integration/
310
+ e2e/
311
+ snapshots/
312
+ ```
313
+
314
+ ---
315
+
316
+ ##### Highlights:
317
+
318
+ - Real-world fixtures (SPA + MPA, JS/TS, SCSS/Less)
319
+ - Snapshot-based regression detection
320
+ - Stable config normalization for testing
321
+
322
+ ---
323
+
324
+ #### Internal Improvements
325
+
326
+ - Refactored config creation:
327
+ - `createBaseConfig`
328
+ - `createDevConfig`
329
+ - `createProdConfig`
330
+ - Improved merge strategies:
331
+ - `resolve`
332
+ - `devServer`
333
+ - `optimization`
334
+ - Stronger typing across entire codebase
335
+
336
+ #### Cleanup
337
+
338
+ - Removed legacy config patterns
339
+ - Simplified public API
340
+ - Reduced internal coupling
341
+
342
+ ---
343
+
344
+ ### Breaking Changes
345
+
346
+ - Template system is no longer strictly tied to Pug
347
+ - `pugRule` and `PugTemplatesPlugin` are now conditionally applied
348
+ - Invalid combinations are now validated:
349
+ - `templates.type = 'none'` cannot have `entry
350
+ - `MPA` requires `templates.entry`
351
+
352
+ ---------------------------------------
353
+
354
+ ## Legacy (pre-1.0.0)
355
+
356
+ All versions prior to 1.0.0 belong to the package:
357
+
358
+ ```text
359
+ @razerspine/webpack-core
360
+ ```
361
+
362
+ Legacy versions include:
363
+
364
+ - Early architecture
365
+ - Initial template system
366
+ - Basic config generation
367
+
368
+ > These versions are no longer actively maintained.
369
+
370
+ ## [1.10.0] - 2026-03-13
371
+
372
+ ### Changed
373
+
374
+ - **Dependency Update**: Upgraded `pug-plugin` to `^6.1.0`.
375
+ - Fixes vulnerabilities in transitive dependencies by forcing `minimatch@10` and `glob@13`.
376
+ - Includes the latest `html-bundler-webpack-plugin` for improved asset handling.
377
+ - **Environment Requirements**: Updated minimum required **Node.js version to 20**.
378
+ - **Cleanup**: Prepared for the removal of manual `overrides` in consumer templates (
379
+ resolves [issue #110](https://github.com/webdiscus/pug-plugin/issues/110)).
380
+
381
+ ### Fixed
382
+
383
+ - **Security**: Eliminated deep-level dependency warnings related to older versions of `glob` and `minimatch`.
384
+
385
+ ---
386
+
387
+ ## [1.9.0] - 2026-03-13
388
+
389
+ ### Added
390
+
391
+ - **Smart Auto-Hosting Adapter**
392
+ - Integrated `detectHosting()` utility to automatically identify deployment platforms (**Vercel, Netlify, Cloudflare,
393
+ GitHub Pages**).
394
+ - **Zero-Config Routing**: Automatically generates platform-specific configuration files (`_redirects`, `vercel.json`)
395
+ based on `appType`.
396
+ - **Interactive Build Logs**: Added `infrastructureLogger` integration. The build now informs the developer about
397
+ detected platforms (e.g., `📦 Netlify detected. Generating _redirects for SPA...`).
398
+ - **Enhanced SPA Fallback Strategy**
399
+ - Automated `404.html` generation for **GitHub Pages** and static hosts when in SPA mode.
400
+ - Ensures seamless client-side routing without manual file duplication.
401
+
402
+ ### Changed
403
+
404
+ - **Architectural Refactoring**
405
+ - Decoupled hosting logic into specialized utilities: `getRedirects`, `getVercelConfig`, and `detectHosting`.
406
+ - Improved `createProdConfig` maintainability by moving business logic out of the main configuration factory.
407
+ - **Production Alignment**
408
+ - `createProdConfig` now actively reads `_meta.appType` from `LoaderOptionsPlugin` to synchronize routing logic with
409
+ the development server.
410
+
411
+ ### Fixed
412
+
413
+ - **Type Safety**: Improved Webpack 5 internal typing for asset emission using `sources.RawSource`.
414
+ - **Build Reliability**: Replaced `copy-webpack-plugin` for generated assets with a native Webpack emission strategy to
415
+ prevent "file not found" errors during build.
416
+
417
+ ---
418
+
419
+ ## [1.8.0] - 2026-03-13
420
+
421
+ ### Added
422
+
423
+ - **Automated Deployment Assets Generation**
424
+ - Integrated `RoutingPlugin` into `createProdConfig` to handle host-specific routing files.
425
+ - **Vercel Support**: Automatically generates `vercel.json` with correct rewrite rules based on `appType`.
426
+ - **Netlify/Cloudflare Support**: Automatically generates `_redirects` file.
427
+ - **Zero-Config Deployment**: Routing files are generated in-memory during the build and emitted directly to the
428
+ `dist` folder.
429
+ - **Enhanced SPA Fallback**
430
+ - Added automatic generation of `404.html` (as a copy of `index.html`) for SPA mode.
431
+ - Ensures seamless routing on platforms like **GitHub Pages** without manual configuration.
432
+
433
+ ### Fixed
434
+
435
+ - **Type Safety**: Improved Webpack 5 internal typing for asset emission using `sources.RawSource`.
436
+ - **Build Reliability**: Replaced `copy-webpack-plugin` for generated assets with a native Webpack emission strategy to
437
+ prevent "file not found" errors during build.
438
+
439
+ ### Changed
440
+
441
+ - **Production Alignment**: `createProdConfig` now actively reads `_meta.appType` from `LoaderOptionsPlugin` to
442
+ synchronize routing logic with the development server.
443
+
444
+ ---
445
+
446
+ ## [1.7.2] - 2026-02-22
447
+
448
+ ### Added
449
+
450
+ - **Universal Pug Loading Strategy**
451
+ - Introduced `pugRule()` with `oneOf` logic to handle different Pug contexts.
452
+ - **Component Support**: Pug files imported via JS/TS are now compiled into functions (`method: 'compile'`), enabling
453
+ Angular-like component architecture.
454
+ - **Static Entry Support**: Pug files used as entry points continue to render as static HTML (`method: 'render'`).
455
+ - This dual-mode approach ensures SPA components work seamlessly without breaking existing MPA templates.
456
+ - **Dynamic SPA Routing Infrastructure**
457
+ - Added support for client-side routing by decoupling Pug templates from the global layout in SPA mode.
458
+ - Enabled support for `document.title` updates and `data-link` interception within the starter templates.
459
+
460
+ ### Changed
461
+
462
+ - **Refactored** `templatesLoader`
463
+ - Decoupled loader logic from the `PugPlugin` instance.
464
+ - Removed global `loaderOptions` from `PugPlugin` to delegate responsibility to the new specialized `pugRule()`.
465
+ - Improved compatibility between dynamic imports and static page generation.
466
+ - **Clean Architecture Alignment**
467
+ - Updated `base.ts` to include `pugRule()` in `module.rules`, establishing a standard for how assets are resolved
468
+ across all 8
469
+ - template variations (JS/TS, SCSS/Less, MPA/SPA).
470
+
471
+ ---
472
+
473
+ ## [1.7.1] - 2026-02-22
474
+
475
+ ### Added
476
+
477
+ - **SPA Support (Experimental Stable API)**
478
+ - Introduced new `appType` option: `'mpa' | 'spa'`
479
+ - `mpa` remains the default mode (template directory driven)
480
+ - `spa` mode supports a single Pug entry file and outputs `index.html`
481
+ - Enables SPA-style projects while preserving template-driven architecture
482
+
483
+ - **Options Normalization Layer**
484
+ - Introduced `normalizeCoreOptions()` (internal utility)
485
+ - Centralized default resolution for:
486
+ - `mode`
487
+ - `appType`
488
+ - `templates.entry`
489
+ - `resolve.alias`
490
+ - Eliminates duplicated fallback logic across config layers
491
+ - Establishes a single source of truth for configuration defaults
492
+
493
+ - **Improved Templates Validation**
494
+ - Validation logic now differentiates between:
495
+ - Directory entry (MPA)
496
+ - Single file entry (SPA)
497
+ - Prevents incorrect entry usage at build initialization
498
+
499
+ ### Changed
500
+
501
+ - **Architecture Refactor**
502
+ - Removed default resolution logic from `templatesLoader`
503
+ - Simplified `validateCoreOptions` to focus only on value validation
504
+ - Moved filesystem validation responsibility into template loader
505
+ - Improved internal separation of concerns
506
+
507
+ - **Cleaner Internal API Design**
508
+ - Base config now operates on normalized options
509
+ - Reduced configuration coupling
510
+ - Improved long-term scalability (SSR / future app types)
511
+
512
+ ### Notes
513
+
514
+ - No breaking changes were introduced.
515
+ - Default behavior remains `mpa`.
516
+ - Fully backward compatible with existing templates.
517
+ - SPA mode is stable but recommended for controlled usage.
518
+
519
+ ---
520
+
521
+ ## [1.4.1] - 2026-02-19
522
+
523
+ ### Changed
524
+
525
+ - **Package Metadata**: Updated `package.json` to reflect its place within the monorepo.
526
+ - Added `repository` information pointing to the specific subdirectory.
527
+ - Added `homepage` and `bugs` URLs for better transparency and issue tracking.
528
+
529
+ ---
530
+
531
+ ## [1.4.0] - 2026-02-19
532
+
533
+ ### Changed
534
+
535
+ - **Peer Dependency**: Updated `pug-plugin` peer dependency range from `^5` to `^5 || ^6`.
536
+ - Enables compatibility with `pug-plugin@6`.
537
+ - Removes installation conflicts when templates upgrade to the latest pug-plugin version.
538
+ - Preserves backward compatibility with existing templates using v5.
539
+ - **Internal Dev Alignment**: Updated local `devDependencies` to use `pug-plugin@^6.0.0` for internal testing and
540
+ validation.
541
+
542
+ ### Security
543
+
544
+ - Resolves npm audit warnings caused by transitive dependencies
545
+ (`js-beautify → editorconfig → glob → minimatch`).
546
+ - No runtime changes were introduced.
547
+ - No production bundle impact.
548
+
549
+ ### Notes
550
+
551
+ - This release does **not introduce breaking changes**.
552
+ - Public API remains unchanged.
553
+ - Fully backward compatible with existing templates.
554
+ - Recommended update before upgrading templates to `pug-plugin@6`.
555
+
556
+ ---
557
+
558
+ ## [1.2.3] - 2026-02-17
559
+
560
+ ### Added
561
+
562
+ - **Validation Layer**: Introduced `validateCoreOptions()` inside `createBaseConfig`.
563
+ - Validates `mode`, `scripts`, and `styles` values.
564
+ - Ensures the templates entry directory exists before Webpack initialization.
565
+ - Prevents silent runtime failures in pug-plugin due to invalid configuration.
566
+
567
+ ### Changed
568
+
569
+ - **Dev Server Default Behavior**: Enabled `open: true` in default `devServer` configuration.
570
+ - Development server now automatically opens the browser.
571
+ - Improves developer experience for starter templates.
572
+
573
+ ### Notes
574
+
575
+ - This release does **not introduce breaking changes**.
576
+ - Public API remains unchanged.
577
+ - Existing templates continue to work without modification.
578
+
579
+ ---
580
+
581
+ ## [1.2.1] - 2026-02-12
582
+
583
+ ### Added
584
+
585
+ - **Flexible Configurations:** Added an optional `options` argument to both `createDevConfig` and `createProdConfig`.
586
+ - Users can now override default `devServer` settings or Webpack production optimizations without losing the base
587
+ functionality.
588
+ - Integrated `webpack-merge` into `createDevConfig` for safer property merging.
589
+
590
+ ### Fixed
591
+
592
+ - Updated internal documentation and clarified version history in `CHANGELOG.md`.
593
+
594
+ ---
595
+
596
+ ## [1.2.0] - 2026-02-12
597
+
598
+ ### Changed
599
+
600
+ - **Enhanced File Watching:** Updated `createDevConfig` to watch all files recursively in the `src/` directory (
601
+ `src/**/*`). This ensures `webpack-dev-server` reacts to changes in any file type (images, JSON, new assets) without
602
+ manual configuration.
603
+ - **Improved Dev Routing:** Configured `historyApiFallback` in development mode.
604
+ - Set `disableDotRule: true` to allow dots in URLs (useful for complex routing).
605
+ - Added a global rewrite rule to serve `/404.html` for any non-existent paths, enabling better local testing of 404
606
+ error pages and SPA-like navigation.
607
+ - **DevServer Optimization:** Set `hot: false` and `liveReload: true` as a stable default for multipage template builds
608
+ to ensure consistent page refreshes upon file changes.
609
+
610
+ ---
611
+
612
+ ## [1.1.7] - 2026-02-11
613
+
614
+ ### Changed
615
+
616
+ - Updated `README.md`
617
+ - Updated `package.json` metadata (keywords, published files)
618
+
619
+ ### Stable Release Note
620
+
621
+ - **Important:** Versions prior to 1.1.6 were part of a stabilization phase and are not recommended for production use.
622
+ This release marks the stable baseline.
623
+
624
+ ---
625
+
626
+ ## [1.1.6] - 2026-02-05
627
+
628
+ ### Changed
629
+
630
+ - Updated `package.json` metadata (keywords, published files)
631
+ - Updated `README.md`
632
+
633
+ ---
634
+
635
+ ## [1.1.5] - 2026-02-05
636
+
637
+ ### Fixed
638
+
639
+ - Stabilized production webpack configuration for pug-plugin driven builds
640
+ - Disabled `splitChunks` and `runtimeChunk` to prevent asset resolution issues
641
+ - Ensured predictable output structure in production mode
642
+ - Reduced risk of entry-related build failures
643
+
644
+ ### Notes
645
+
646
+ - This release finalizes the stabilization phase of the production configuration
647
+ - Recommended as a stable baseline for template usage
648
+
649
+ ---
650
+
651
+ ## [1.1.4] - 2026-02-05
652
+
653
+ ### Fixed
654
+
655
+ - Final stabilization of production configuration
656
+ - Ensured consistent build behavior for pug-plugin driven templates
657
+
658
+ ---
659
+
660
+ ## [1.1.0 – 1.1.3] - 2026-02-05
661
+
662
+ ### Fixed
663
+
664
+ - Multiple fixes for production configuration edge cases
665
+ - Improved compatibility between pug-plugin, assets loader, and webpack optimization
666
+ - Stabilized production builds for template-driven entry points
667
+
668
+ ---
669
+
670
+ ## [1.0.9] - 2026-02-05
671
+
672
+ ### Fixed
673
+
674
+ - Removed implicit webpack entry from production config
675
+ - Fixed production build failure caused by default webpack entry resolution
676
+
677
+ ---
678
+
679
+ ## [1.0.8] - 2026-02-05
680
+
681
+ ### Fixed
682
+
683
+ - Fixed `resolve.alias` handling across loaders and pug-plugin
684
+
685
+ ---
686
+
687
+ ## [1.0.7] - 2026-02-05
688
+
689
+ ### Fixed
690
+
691
+ - Fixed Pug asset resolution in production mode
692
+ - Passed webpack `resolve.alias` into pug-plugin resolver
693
+ - Ensured consistent alias behavior in development and production
694
+
695
+ ---
696
+
697
+ ## [1.0.6] - 2026-02-05
698
+
699
+ ### Fixed
700
+
701
+ - Fixed webpack plugin instance mismatch when used via `npm link`
702
+ - Moved `webpack-dev-server` and `pug-plugin` to `peerDependencies`
703
+ - Ensured a single webpack instance is used in consumer templates
704
+
705
+ ---
706
+
707
+ ## [1.0.5] - 2026-02-04
708
+
709
+ ### Fixed
710
+
711
+ - Explicitly disabled webpack default entry (`./src`)
712
+ - Ensured stable behavior when using pug-plugin as the primary entry system
713
+
714
+ ---
715
+
716
+ ## [1.0.4] - 2026-02-04
717
+
718
+ ### Fixed
719
+
720
+ - Fixed TypeScript typing for `webpack-dev-server`
721
+ - Properly extended webpack Configuration with devServer types
722
+
723
+ ---
724
+
725
+ ## [1.0.3] - 2026-02-04
726
+
727
+ ### Fixed
728
+
729
+ - Fixed webpack default entry fallback (`./src`)
730
+ - Prevented webpack from resolving non-existing JS entry when using pug-plugin
731
+ - Stabilized template entry handling via `templatesLoader`
732
+
733
+ ### Internal
734
+
735
+ - Clarified responsibility between webpack entry and pug-plugin entry
736
+
737
+ ---
738
+
739
+ ## [1.0.2] - 2026-02-04
740
+
741
+ ### Fixed
742
+
743
+ - Fixed ENV mode option typing
744
+ - Stabilized base configuration behavior
745
+
746
+ ## [Unreleased]
747
+
748
+ ### Changed
749
+
750
+ - Updated README.md