@digest/webpack 4.0.7 → 4.0.9

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 @@
1
+ export {};
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const node_path_1 = __importDefault(require("node:path"));
7
+ const scripts_1 = require("@digest/scripts");
8
+ const threadLoader = require('./threadLoader');
9
+ const configuration = require('./webpack.config');
10
+ const { cache } = scripts_1.config;
11
+ const scriptLoaders = (options = {}) => {
12
+ return [].concat(scripts_1.config.parallel ?
13
+ [
14
+ threadLoader
15
+ ] :
16
+ [], scripts_1.config.babel &&
17
+ scripts_1.config.webpackBabel ?
18
+ [
19
+ {
20
+ loader: 'babel-loader',
21
+ options: {
22
+ cacheDirectory: cache ?
23
+ node_path_1.default.join(cache, 'babel-loader') :
24
+ false,
25
+ configFile: scripts_1.config.babel
26
+ }
27
+ }
28
+ ] :
29
+ [], options.typescript ?
30
+ [].concat(!scripts_1.production &&
31
+ scripts_1.config.angular &&
32
+ scripts_1.config.webpackAngular ?
33
+ [
34
+ {
35
+ loader: 'angular2-template-loader'
36
+ },
37
+ {
38
+ loader: '@angularclass/hmr-loader'
39
+ }
40
+ ] :
41
+ []) :
42
+ [], [
43
+ {
44
+ loader: 'source-map-loader'
45
+ }
46
+ ]);
47
+ };
48
+ module.exports = scriptLoaders;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const scripts_1 = require("@digest/scripts");
7
+ const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
8
+ const threadLoader = require('./threadLoader');
9
+ const configuration = require('./webpack.config');
10
+ const styleLoaders = (options = {}) => {
11
+ options.camelCase = options.camelCase === undefined ?
12
+ true :
13
+ options.camelCase;
14
+ return [].concat(scripts_1.production ?
15
+ [
16
+ {
17
+ loader: mini_css_extract_plugin_1.default.loader,
18
+ options: {
19
+ publicPath: './'
20
+ }
21
+ }
22
+ ] :
23
+ [
24
+ threadLoader,
25
+ {
26
+ loader: 'style-loader'
27
+ }
28
+ ], [
29
+ {
30
+ loader: 'css-loader',
31
+ options: {
32
+ importLoaders: 1,
33
+ modules: options.modules ?
34
+ {
35
+ exportLocalsConvention: options.camelCase ?
36
+ 'camelCase' :
37
+ 'asIs',
38
+ localIdentName: scripts_1.config.library ?
39
+ `${scripts_1.config.shortName}-[local]` :
40
+ `[local]-[hash:${scripts_1.config.hashLimit}]`
41
+ } :
42
+ undefined,
43
+ sourceMap: options.sourceMap
44
+ }
45
+ }
46
+ ], options.postcss ?
47
+ [
48
+ {
49
+ loader: 'postcss-loader',
50
+ options: {
51
+ postcssOptions: {
52
+ ctx: {},
53
+ path: scripts_1.config.webpackPostCSS
54
+ },
55
+ sourceMap: options.sourceMap
56
+ }
57
+ }
58
+ ] :
59
+ []);
60
+ };
61
+ module.exports = styleLoaders;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const node_os_1 = __importDefault(require("node:os"));
7
+ const workers = node_os_1.default.cpus().length - 2 < 1 ?
8
+ 1 :
9
+ node_os_1.default.cpus().length - 2;
10
+ const threadLoader = {
11
+ loader: 'thread-loader',
12
+ options: {
13
+ workers
14
+ }
15
+ };
16
+ module.exports = threadLoader;
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a, _b;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- const node_os_1 = __importDefault(require("node:os"));
8
7
  const node_path_1 = __importDefault(require("node:path"));
9
8
  const node_v8_1 = __importDefault(require("node:v8"));
10
9
  const scripts_1 = require("@digest/scripts");
@@ -26,6 +25,8 @@ const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer");
26
25
  const webpack_favicons_1 = __importDefault(require("webpack-favicons"));
27
26
  const webpack_node_externals_1 = __importDefault(require("webpack-node-externals"));
28
27
  const webpack_subresource_integrity_1 = require("webpack-subresource-integrity");
28
+ const scriptLoaders = require('./scriptLoaders');
29
+ const styleLoaders = require('./styleLoaders');
29
30
  const { cache } = scripts_1.config;
30
31
  let GenerateSW;
31
32
  let WorkboxEntry;
@@ -62,103 +63,6 @@ if (!scripts_1.production &&
62
63
  scripts_1.config.webpackReact) {
63
64
  ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
64
65
  }
65
- const workers = node_os_1.default.cpus().length - 2 < 1 ?
66
- 1 :
67
- node_os_1.default.cpus().length - 2;
68
- const threadLoader = {
69
- loader: 'thread-loader',
70
- options: {
71
- workers
72
- }
73
- };
74
- const styleLoaders = (options = {}) => {
75
- options.camelCase = options.camelCase === undefined ?
76
- true :
77
- options.camelCase;
78
- return [].concat(scripts_1.production ?
79
- [
80
- {
81
- loader: mini_css_extract_plugin_1.default.loader,
82
- options: {
83
- publicPath: './'
84
- }
85
- }
86
- ] :
87
- [
88
- threadLoader,
89
- {
90
- loader: 'style-loader'
91
- }
92
- ], [
93
- {
94
- loader: 'css-loader',
95
- options: {
96
- importLoaders: 1,
97
- modules: options.modules ?
98
- {
99
- exportLocalsConvention: options.camelCase ?
100
- 'camelCase' :
101
- 'asIs',
102
- localIdentName: scripts_1.config.library ?
103
- `${scripts_1.config.shortName}-[local]` :
104
- `[local]-[hash:${scripts_1.config.hashLimit}]`
105
- } :
106
- undefined,
107
- sourceMap: options.sourceMap
108
- }
109
- }
110
- ], options.postcss ?
111
- [
112
- {
113
- loader: 'postcss-loader',
114
- options: {
115
- postcssOptions: {
116
- ctx: {},
117
- path: scripts_1.config.webpackPostCSS
118
- },
119
- sourceMap: options.sourceMap
120
- }
121
- }
122
- ] :
123
- []);
124
- };
125
- const scriptLoaders = (options = {}) => {
126
- return [].concat(scripts_1.config.parallel ?
127
- [
128
- threadLoader
129
- ] :
130
- [], scripts_1.config.babel &&
131
- scripts_1.config.webpackBabel ?
132
- [
133
- {
134
- loader: 'babel-loader',
135
- options: {
136
- cacheDirectory: cache ?
137
- node_path_1.default.join(cache, 'babel-loader') :
138
- false,
139
- configFile: scripts_1.config.babel
140
- }
141
- }
142
- ] :
143
- [], options.typescript ?
144
- [].concat(!scripts_1.production &&
145
- scripts_1.config.angular &&
146
- scripts_1.config.webpackAngular ?
147
- [
148
- {
149
- loader: 'angular2-template-loader'
150
- },
151
- {
152
- loader: '@angularclass/hmr-loader'
153
- }
154
- ] :
155
- []) :
156
- [], [
157
- {
158
- loader: 'source-map-loader'
159
- }
160
- ]);
161
- };
162
66
  const generateName = (extension, chunkName) => {
163
67
  const hash = extension === 'css' ?
164
68
  `[contenthash:${scripts_1.config.hashLimit}]` :
@@ -692,8 +596,4 @@ const configuration = {
692
596
  'es5'
693
597
  ]
694
598
  };
695
- module.exports = {
696
- configuration,
697
- scriptLoaders,
698
- styleLoaders
699
- };
599
+ module.exports = configuration;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@digest/webpack",
3
3
  "title": "Webpack Digest",
4
4
  "license": "LGPL-3.0-or-later",
5
- "version": "4.0.7",
5
+ "version": "4.0.9",
6
6
  "description": "Digested Webpack Configurations",
7
7
  "author": {
8
8
  "name": "wallzero @wallzeroblog",
@@ -26,6 +26,12 @@
26
26
  "main": "dist/webpack.config.js",
27
27
  "types": "dist/webpack.config.d.ts",
28
28
  "files": [
29
+ "/dist/scriptLoaders.d.ts",
30
+ "/dist/scriptLoaders.js",
31
+ "/dist/styleLoaders.d.ts",
32
+ "/dist/styleLoaders.js",
33
+ "/dist/threadLoader.d.ts",
34
+ "/dist/threadLoader.js",
29
35
  "/dist/webpack.config.d.ts",
30
36
  "/dist/webpack.config.js",
31
37
  "/share/favicon.png",
@@ -41,8 +47,8 @@
41
47
  "clean": "rimraf node_modules dist package-lock.json npm-debug.log"
42
48
  },
43
49
  "dependencies": {
44
- "@digest/scripts": "^4.0.7",
45
- "@swc/core": "^1.3.7",
50
+ "@digest/scripts": "^4.0.9",
51
+ "@swc/core": "^1.3.9",
46
52
  "@vue/preload-webpack-plugin": "^2.0.0",
47
53
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
48
54
  "circular-dependency-plugin": "^5.2.2",
@@ -74,11 +80,11 @@
74
80
  "webpack-subresource-integrity": "^5.1.0"
75
81
  },
76
82
  "devDependencies": {
77
- "@digest/webpack-workbox": "^4.0.7",
83
+ "@digest/webpack-workbox": "^4.0.9",
78
84
  "@types/clean-webpack-plugin": "^0.1.3",
79
85
  "@types/ip": "^1.1.0",
80
86
  "@types/mini-css-extract-plugin": "^2.5.1",
81
- "@types/node": "^18.8.5",
87
+ "@types/node": "^18.11.2",
82
88
  "@types/terser-webpack-plugin": "^5.2.0",
83
89
  "@types/webpack-bundle-analyzer": "^4.6.0",
84
90
  "@types/webpack-env": "^1.18.0"