@razerspine/webpack-core 1.1.6 → 1.2.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,141 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ This package went through an intensive stabilization phase while integrating
6
+ Webpack, pug-plugin, and template-driven builds. Multiple patch releases were
7
+ required to ensure correct behavior in both development and production modes.
8
+
9
+ ---
10
+
11
+ ## [1.2.0] - 2026-02-12
12
+
13
+ ### Changed
14
+ - **Enhanced File Watching:** Updated `createDevConfig` to watch all files recursively in the `src/` directory (`src/**/*`). This ensures `webpack-dev-server` reacts to changes in any file type (images, JSON, new assets) without manual configuration.
15
+ - **Improved Dev Routing:** Configured `historyApiFallback` in development mode.
16
+ - Set `disableDotRule: true` to allow dots in URLs (useful for complex routing).
17
+ - Added a global rewrite rule to serve `/404.html` for any non-existent paths, enabling better local testing of 404 error pages and SPA-like navigation.
18
+ - **DevServer Optimization:** Set `hot: false` and `liveReload: true` as a stable default for multi-page template builds to ensure consistent page refreshes upon file changes.
19
+
20
+ ---
21
+
22
+ ## [1.1.7] - 2026-02-11
23
+
24
+ ### Changed
25
+ - Updated `README.md`
26
+ - Updated `package.json` metadata (keywords, published files)
27
+
28
+ ### Stable Release Note
29
+ - **Important:** Versions prior to 1.1.6 were part of a stabilization phase and are not recommended for production use. This release marks the stable baseline.
30
+
31
+ ---
32
+
33
+ ## [1.1.6] - 2026-02-05
34
+
35
+ ### Changed
36
+ - Updated `package.json` metadata (keywords, published files)
37
+ - Updated `README.md`
38
+
39
+ ---
40
+
41
+ ## [1.1.5] - 2026-02-05
42
+
43
+ ### Fixed
44
+ - Stabilized production webpack configuration for pug-plugin driven builds
45
+ - Disabled `splitChunks` and `runtimeChunk` to prevent asset resolution issues
46
+ - Ensured predictable output structure in production mode
47
+ - Reduced risk of entry-related build failures
48
+
49
+ ### Notes
50
+ - This release finalizes the stabilization phase of the production configuration
51
+ - Recommended as a stable baseline for template usage
52
+
53
+ ---
54
+
55
+ ## [1.1.4] - 2026-02-05
56
+
57
+ ### Fixed
58
+ - Final stabilization of production configuration
59
+ - Ensured consistent build behavior for pug-plugin driven templates
60
+
61
+ ---
62
+
63
+ ## [1.1.0 – 1.1.3] - 2026-02-05
64
+
65
+ ### Fixed
66
+ - Multiple fixes for production configuration edge cases
67
+ - Improved compatibility between pug-plugin, assets loader, and webpack optimization
68
+ - Stabilized production builds for template-driven entry points
69
+
70
+ ---
71
+
72
+ ## [1.0.9] - 2026-02-05
73
+
74
+ ### Fixed
75
+ - Removed implicit webpack entry from production config
76
+ - Fixed production build failure caused by default webpack entry resolution
77
+
78
+ ---
79
+
80
+ ## [1.0.8] - 2026-02-05
81
+
82
+ ### Fixed
83
+ - Fixed `resolve.alias` handling across loaders and pug-plugin
84
+
85
+ ---
86
+
87
+ ## [1.0.7] - 2026-02-05
88
+
89
+ ### Fixed
90
+ - Fixed Pug asset resolution in production mode
91
+ - Passed webpack `resolve.alias` into pug-plugin resolver
92
+ - Ensured consistent alias behavior in development and production
93
+
94
+ ---
95
+
96
+ ## [1.0.6] - 2026-02-05
97
+
98
+ ### Fixed
99
+ - Fixed webpack plugin instance mismatch when used via `npm link`
100
+ - Moved `webpack-dev-server` and `pug-plugin` to `peerDependencies`
101
+ - Ensured a single webpack instance is used in consumer templates
102
+
103
+ ---
104
+
105
+ ## [1.0.5] - 2026-02-04
106
+
107
+ ### Fixed
108
+ - Explicitly disabled webpack default entry (`./src`)
109
+ - Ensured stable behavior when using pug-plugin as the primary entry system
110
+
111
+ ---
112
+
113
+ ## [1.0.4] - 2026-02-04
114
+
115
+ ### Fixed
116
+ - Fixed TypeScript typing for `webpack-dev-server`
117
+ - Properly extended webpack Configuration with devServer types
118
+
119
+ ---
120
+
121
+ ## [1.0.3] - 2026-02-04
122
+
123
+ ### Fixed
124
+ - Fixed webpack default entry fallback (`./src`)
125
+ - Prevented webpack from resolving non-existing JS entry when using pug-plugin
126
+ - Stabilized template entry handling via `templatesLoader`
127
+
128
+ ### Internal
129
+ - Clarified responsibility between webpack entry and pug-plugin entry
130
+
131
+ ---
132
+
133
+ ## [1.0.2] - 2026-02-04
134
+
135
+ ### Fixed
136
+ - Fixed ENV mode option typing
137
+ - Stabilized base configuration behavior
138
+
139
+ ## [Unreleased]
140
+ ### Changed
141
+ - Updated README.md
package/README.md CHANGED
@@ -1,30 +1,62 @@
1
1
  # @razerspine/webpack-core
2
2
 
3
- Core webpack configuration and loaders for modern **Pug-based** projects.
3
+ Core webpack configuration and loaders for **Pug-based** projects.
4
4
 
5
- This package provides a stable, production-safe webpack foundation designed
6
- to work seamlessly with `pug-plugin` and template-driven builds.
5
+ This package provides a stable, production-safe webpack foundation for
6
+ template-driven builds using `pug-plugin`.
7
7
 
8
8
  ---
9
9
 
10
+ ## ⚠️ Important
11
+
12
+ Versions prior to 1.1.6 were part of a stabilization phase and are not recommended for production use.
13
+
14
+ Please use:
15
+ ```bash
16
+ npm install @razerspine/webpack-core@^1.1.6
17
+ ```
18
+
10
19
  ## Designed for
11
20
 
12
21
  This package is developed as part of the
13
22
  [Webpack Starter Monorepo](https://github.com/Razerspine/webpack-starter-monorepo).
14
23
 
15
24
  It contains shared webpack configuration and loaders used by the starter
16
- templates, but **can also be used independently** in custom setups.
25
+ templates, but can also be used independently.
26
+
27
+ ---
28
+
29
+ ## Design principles
30
+
31
+ - Webpack is responsible for:
32
+ - module resolution
33
+ - aliases (`resolve.alias`)
34
+ - asset handling
35
+
36
+ - Loaders and plugins:
37
+ - do not define aliases
38
+ - do not depend on UI kits
39
+ - do not assume project structure
40
+
41
+ - `pug-plugin` is used only to compile templates
42
+ Asset paths are resolved by webpack.
43
+
44
+ - Webpack JS entry is intentionally disabled
45
+ Builds are driven by template entries.
46
+
47
+ - No aggressive production optimizations by default
48
+ (e.g. no `splitChunks`)
17
49
 
18
50
  ---
19
51
 
20
52
  ## Features
21
53
 
22
- - Pug templates support (via `pug-plugin`)
23
- - JavaScript / TypeScript scripts
24
- - SCSS / Less styles
25
- - Environment-aware configuration
26
- - No hardcoded aliases or UI-kit dependencies
27
- - Production-safe defaults (no aggressive chunk splitting)
54
+ - Pug templates support
55
+ - JavaScript / TypeScript
56
+ - SCSS / Less
57
+ - Environment-aware configuration
58
+ - No hardcoded aliases
59
+ - Production-safe defaults
28
60
 
29
61
  ---
30
62
 
@@ -32,3 +64,47 @@ templates, but **can also be used independently** in custom setups.
32
64
 
33
65
  ```bash
34
66
  npm install @razerspine/webpack-core
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Usage
72
+
73
+ ```js
74
+ const path = require('path');
75
+ const {
76
+ createBaseConfig,
77
+ createDevConfig,
78
+ createProdConfig,
79
+ } = require('@razerspine/webpack-core');
80
+
81
+ module.exports = (env = {}, argv = {}) => {
82
+ const mode = argv.mode || 'development';
83
+
84
+ const baseConfig = createBaseConfig({
85
+ mode,
86
+ scripts: 'js',
87
+ styles: 'less',
88
+ templates: {
89
+ entry: 'src/views/pages',
90
+ },
91
+ resolve: {
92
+ alias: {
93
+ '@views': path.resolve(process.cwd(), 'src/views'),
94
+ '@styles': path.resolve(process.cwd(), 'src/assets/styles'),
95
+ '@scripts': path.resolve(process.cwd(), 'src/assets/scripts'),
96
+ '@images': path.resolve(process.cwd(), 'src/assets/images'),
97
+ },
98
+ },
99
+ });
100
+
101
+ return mode === 'development'
102
+ ? createDevConfig(baseConfig)
103
+ : createProdConfig(baseConfig);
104
+ };
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 📄 License
110
+ This project is licensed under the ISC License.
@@ -4,19 +4,21 @@ exports.createDevConfig = createDevConfig;
4
4
  function createDevConfig(baseConfig) {
5
5
  return {
6
6
  ...baseConfig,
7
- /**
8
- * Prevent webpack-dev-server from injecting ./src entry
9
- */
10
- entry: () => ({}),
11
- devtool: 'eval-source-map',
7
+ devtool: 'source-map',
12
8
  devServer: {
13
- static: {
14
- directory: 'public',
15
- },
16
- hot: true,
17
- open: true,
9
+ hot: false,
10
+ liveReload: true,
18
11
  compress: true,
19
12
  port: 8080,
20
- },
13
+ watchFiles: [
14
+ 'src/**/*',
15
+ ],
16
+ historyApiFallback: {
17
+ disableDotRule: true,
18
+ rewrites: [
19
+ { from: /./, to: '/404.html' }
20
+ ]
21
+ }
22
+ }
21
23
  };
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@razerspine/webpack-core",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
4
4
  "description": "Core webpack config and loaders for starter templates",
5
5
  "keywords": [
6
6
  "webpack",
@@ -8,7 +8,6 @@
8
8
  "pug",
9
9
  "pug-plugin"
10
10
  ],
11
-
12
11
  "license": "ISC",
13
12
  "author": "Razerspine",
14
13
  "type": "commonjs",
@@ -16,7 +15,8 @@
16
15
  "types": "dist/index.d.ts",
17
16
  "files": [
18
17
  "dist",
19
- "README.md"
18
+ "README.md",
19
+ "CHANGELOG.md"
20
20
  ],
21
21
  "scripts": {
22
22
  "build": "tsc -p tsconfig.json",