@razerspine/webpack-core 1.1.4 → 1.1.6
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/README.md +20 -46
- package/dist/config/prod.js +8 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,60 +1,34 @@
|
|
|
1
1
|
# @razerspine/webpack-core
|
|
2
2
|
|
|
3
|
+
Core webpack configuration and loaders for modern **Pug-based** projects.
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
This package provides a stable, production-safe webpack foundation designed
|
|
6
|
+
to work seamlessly with `pug-plugin` and template-driven builds.
|
|
7
|
+
|
|
8
|
+
---
|
|
5
9
|
|
|
6
10
|
## Designed for
|
|
7
11
|
|
|
8
|
-
This package is developed as part of the
|
|
12
|
+
This package is developed as part of the
|
|
9
13
|
[Webpack Starter Monorepo](https://github.com/Razerspine/webpack-starter-monorepo).
|
|
10
14
|
|
|
11
|
-
It
|
|
12
|
-
|
|
15
|
+
It contains shared webpack configuration and loaders used by the starter
|
|
16
|
+
templates, but **can also be used independently** in custom setups.
|
|
17
|
+
|
|
18
|
+
---
|
|
13
19
|
|
|
14
20
|
## Features
|
|
15
21
|
|
|
16
|
-
- Pug templates support
|
|
17
|
-
-
|
|
18
|
-
- SCSS / Less styles
|
|
19
|
-
- Environment-aware
|
|
20
|
-
- No aliases or UI-kit
|
|
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)
|
|
28
|
+
|
|
29
|
+
---
|
|
21
30
|
|
|
22
31
|
## Installation
|
|
32
|
+
|
|
23
33
|
```bash
|
|
24
|
-
npm
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Usage
|
|
28
|
-
|
|
29
|
-
```js
|
|
30
|
-
const {
|
|
31
|
-
createBaseConfig,
|
|
32
|
-
createDevConfig,
|
|
33
|
-
createProdConfig
|
|
34
|
-
} = require('@razerspine/webpack-core');
|
|
35
|
-
|
|
36
|
-
module.exports = (env, argv) => {
|
|
37
|
-
const mode = argv.mode || 'development';
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
...createBaseConfig({
|
|
41
|
-
root: process.cwd(),
|
|
42
|
-
env: {
|
|
43
|
-
mode,
|
|
44
|
-
script: 'js',
|
|
45
|
-
style: 'scss'
|
|
46
|
-
},
|
|
47
|
-
templates: {
|
|
48
|
-
entry: 'src/views/pages'
|
|
49
|
-
}
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
...(mode === 'development'
|
|
53
|
-
? createDevConfig()
|
|
54
|
-
: createProdConfig())
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## 📄 License
|
|
60
|
-
This project is licensed under the ISC License.
|
|
34
|
+
npm install @razerspine/webpack-core
|
package/dist/config/prod.js
CHANGED
|
@@ -7,6 +7,13 @@ function createProdConfig(baseConfig) {
|
|
|
7
7
|
devtool: 'source-map',
|
|
8
8
|
optimization: {
|
|
9
9
|
minimize: true,
|
|
10
|
-
|
|
10
|
+
// ⚠️ splitChunks deliberately disabled
|
|
11
|
+
// pug-plugin manages assets & entries itself
|
|
12
|
+
splitChunks: false,
|
|
13
|
+
runtimeChunk: false,
|
|
14
|
+
},
|
|
15
|
+
performance: {
|
|
16
|
+
hints: false,
|
|
17
|
+
},
|
|
11
18
|
});
|
|
12
19
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razerspine/webpack-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Core webpack config and loaders for starter templates",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"webpack",
|
|
7
|
+
"webpack-config",
|
|
8
|
+
"pug",
|
|
9
|
+
"pug-plugin"
|
|
10
|
+
],
|
|
11
|
+
|
|
5
12
|
"license": "ISC",
|
|
6
13
|
"author": "Razerspine",
|
|
7
14
|
"type": "commonjs",
|
|
8
15
|
"main": "dist/index.js",
|
|
9
16
|
"types": "dist/index.d.ts",
|
|
10
17
|
"files": [
|
|
11
|
-
"dist"
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
12
20
|
],
|
|
13
21
|
"scripts": {
|
|
14
22
|
"build": "tsc -p tsconfig.json",
|