@rootreeweb/rt-webpack-helper 4.1.15 → 4.2.1
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 +12 -0
- package/dist/esm/base.d.ts.map +1 -1
- package/dist/esm/base.js +10 -1
- package/dist/esm/base.js.map +1 -1
- package/dist/esm/types.d.ts +5 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @rootreeweb/rt-webpack-helper
|
|
2
2
|
|
|
3
|
+
## 4.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Chore: Dependency updates
|
|
8
|
+
|
|
9
|
+
## 4.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Add an `externalizeReactVendor` option to `getWebpackConfig` that externalizes `react`, `react-dom`, `react-dom/client`, and `@tanstack/react-query` against a shared `window.RootreeVendor` global, so consuming plugins can opt into a single shared vendor bundle instead of each bundling their own copy.
|
|
14
|
+
|
|
3
15
|
## 4.1.15
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/esm/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,WAAW,EACX,aAAa,IAAI,oBAAoB,EACrC,MAAM,SAAS,CAAC;AAKjB,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GACrB,MAAM,CAUR;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,CAAC,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,gBAAgB,GACxB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,WAAW,EACX,aAAa,IAAI,oBAAoB,EACrC,MAAM,SAAS,CAAC;AAKjB,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GACrB,MAAM,CAUR;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,CAAC,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,gBAAgB,GACxB,oBAAoB,CAwDtB"}
|
package/dist/esm/base.js
CHANGED
|
@@ -31,7 +31,7 @@ export function getOutputName(postfix, extension, options) {
|
|
|
31
31
|
* @returns The webpack configuration.
|
|
32
32
|
*/
|
|
33
33
|
export function getWebpackConfig(entry, options) {
|
|
34
|
-
const { additionalExtensions = [], aliases, devtool = "source-map", outputPath = path.resolve("dist"), } = options ?? {};
|
|
34
|
+
const { additionalExtensions = [], aliases, devtool = "source-map", externalizeReactVendor = false, outputPath = path.resolve("dist"), } = options ?? {};
|
|
35
35
|
const extensions = [
|
|
36
36
|
".tsx",
|
|
37
37
|
".ts",
|
|
@@ -69,6 +69,15 @@ export function getWebpackConfig(entry, options) {
|
|
|
69
69
|
if (entry) {
|
|
70
70
|
baseConfig.entry = entry;
|
|
71
71
|
}
|
|
72
|
+
if (externalizeReactVendor) {
|
|
73
|
+
baseConfig.externals = {
|
|
74
|
+
...baseConfig.externals,
|
|
75
|
+
"@tanstack/react-query": ["RootreeVendor", "ReactQuery"],
|
|
76
|
+
react: ["RootreeVendor", "React"],
|
|
77
|
+
"react-dom": ["RootreeVendor", "ReactDOM"],
|
|
78
|
+
"react-dom/client": ["RootreeVendor", "ReactDOMClient"],
|
|
79
|
+
};
|
|
80
|
+
}
|
|
72
81
|
return baseConfig;
|
|
73
82
|
}
|
|
74
83
|
/**
|
package/dist/esm/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAM9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA6C,MAAM,YAAY,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC5B,OAAe,EACf,SAAiB,EACjB,OAAuB;IAEvB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,IAAI,GAAG,QAAQ,CAAC;IACpB,IAAI,OAAO,EAAE,CAAC;QACb,IAAI,IAAI,gBAAgB,CAAC;IAC1B,CAAC;IACD,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,IAAI,GAAG,GAAG,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC/B,KAAmB,EACnB,OAA0B;IAE1B,MAAM,EACL,oBAAoB,GAAG,EAAE,EACzB,OAAO,EACP,OAAO,GAAG,YAAY,EACtB,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GACjC,GAAG,OAAO,IAAI,EAAE,CAAC;IAClB,MAAM,UAAU,GAAa;Q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;wBACR,SAAS,EAAE,CAAC;wBACZ,QAAQ,EAAE,CAAC,EAAE;wBACb,kBAAkB,EAAE,IAAI;qBACxB;oBACD,cAAc,EAAE;wBACf,QAAQ,EAAE,CAAC,EAAE;wBACb,IAAI,EAAE,wBAAwB;qBAC9B;iBACD;gBACD,oBAAoB,EAAE,KAAK;gBAC3B,gBAAgB,EAAE,EAAE;gBACpB,kBAAkB,EAAE,EAAE;gBACtB,SAAS,EAAE,CAAC;gBACZ,OAAO,EAAE,KAAK;aACd;YACD,WAAW,EAAE,IAAI;SACjB;QACF,CAAC,CAAC,SAAS,CAAC;AACd,CAAC","sourcesContent":["import path from \"path\";\nimport CssMinimizerPlugin from \"css-minimizer-webpack-plugin\";\nimport type {\n\tEntryObject,\n\tConfiguration as WebpackConfiguration,\n} from \"webpack\";\n\nimport { getPlugins } from \"./getPlugins.js\";\nimport { getRules } from \"./getRules.js\";\nimport { getOutputOptions } from \"./outputOptions.js\";\nimport { type GetConfigOptions, type OutputOptions } from \"./types.js\";\n\n/**\n * Creates the name of an output file.\n *\n * @param postfix The file postfix. Ex. `chunk`\n * @param extension The file extension. Ex. `js`\n * @param options The config options pertaining to hashing and filenaming.\n * @returns The output file name to use.\n */\nexport function getOutputName(\n\tpostfix: string,\n\textension: string,\n\toptions?: OutputOptions,\n): string {\n\tconst { useHash, usePostfix } = getOutputOptions(options);\n\tlet name = \"[name]\";\n\tif (useHash) {\n\t\tname += \".[contenthash]\";\n\t}\n\tif (usePostfix && postfix) {\n\t\tname += \".\" + postfix;\n\t}\n\treturn name + \".\" + extension;\n}\n\n/**\n * Get the webpack configuration.\n *\n * @param entry The entry object to use.\n * @param options The options for the configuration.\n * @returns The webpack configuration.\n */\nexport function getWebpackConfig(\n\tentry?: EntryObject,\n\toptions?: GetConfigOptions,\n): WebpackConfiguration {\n\tconst {\n\t\tadditionalExtensions = [],\n\t\taliases,\n\t\tdevtool = \"source-map\",\n\t\toutputPath = path.resolve(\"dist\"),\n\t} = options ?? {};\n\tconst extensions: string[] = [\n\t\t\".tsx\",\n\t\t\".ts\",\n\t\t\".js\",\n\t\t\".css\",\n\t\t\".scss\",\n\t\t...additionalExtensions,\n\t];\n\tconst resolve: NonNullable<WebpackConfiguration[\"resolve\"]> = {\n\t\textensionAlias: {\n\t\t\t\".js\": [\".js\", \".ts\", \".tsx\"],\n\t\t},\n\t\textensions,\n\t};\n\tif (aliases) {\n\t\tresolve.alias = aliases;\n\t}\n\n\tconst baseConfig: WebpackConfiguration = {\n\t\tdevtool,\n\t\tmodule: {\n\t\t\trules: getRules(options),\n\t\t},\n\t\toutput: {\n\t\t\tchunkFilename: getOutputName(\"chunk\", \"js\", options),\n\t\t\tfilename: getOutputName(\"bundle\", \"js\", options),\n\t\t\tpath: outputPath,\n\t\t},\n\t\tplugins: getPlugins(options),\n\t\tresolve,\n\t};\n\tconst optimization = getOptimizationOptions(options);\n\tif (optimization) {\n\t\tbaseConfig.optimization = optimization;\n\t}\n\tif (entry) {\n\t\tbaseConfig.entry = entry;\n\t}\n\treturn baseConfig;\n}\n\n/**\n * Get the options pertaining to optimization.\n *\n * @param options The output options.\n * @returns The optimization settings.\n */\nfunction getOptimizationOptions(\n\toptions?: OutputOptions,\n): WebpackConfiguration[\"optimization\"] {\n\tconst { optimize } = getOutputOptions(options);\n\treturn optimize\n\t\t? {\n\t\t\t\tminimizer: [`...`, new CssMinimizerPlugin()],\n\t\t\t\tsideEffects: true,\n\t\t\t\tsplitChunks: {\n\t\t\t\t\tautomaticNameDelimiter: \"~\",\n\t\t\t\t\tcacheGroups: {\n\t\t\t\t\t\tdefault: {\n\t\t\t\t\t\t\tminChunks: 2,\n\t\t\t\t\t\t\tpriority: -20,\n\t\t\t\t\t\t\treuseExistingChunk: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefaultVendors: {\n\t\t\t\t\t\t\tpriority: -10,\n\t\t\t\t\t\t\ttest: /[\\\\/]node_modules[\\\\/]/,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tenforceSizeThreshold: 50000,\n\t\t\t\t\tmaxAsyncRequests: 30,\n\t\t\t\t\tmaxInitialRequests: 30,\n\t\t\t\t\tminChunks: 1,\n\t\t\t\t\tminSize: 20000,\n\t\t\t\t},\n\t\t\t\tusedExports: true,\n\t\t\t}\n\t\t: undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAM9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA6C,MAAM,YAAY,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC5B,OAAe,EACf,SAAiB,EACjB,OAAuB;IAEvB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,IAAI,GAAG,QAAQ,CAAC;IACpB,IAAI,OAAO,EAAE,CAAC;QACb,IAAI,IAAI,gBAAgB,CAAC;IAC1B,CAAC;IACD,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,IAAI,GAAG,GAAG,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC/B,KAAmB,EACnB,OAA0B;IAE1B,MAAM,EACL,oBAAoB,GAAG,EAAE,EACzB,OAAO,EACP,OAAO,GAAG,YAAY,EACtB,sBAAsB,GAAG,KAAK,EAC9B,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GACjC,GAAG,OAAO,IAAI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AO,UAAU,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,SAAS,sBAAsB,CAC9B,OAAuB;IAEvB,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,QAAQ;QACd,CAAC,CAAC;YACA,SAAS,EAAE,CAAC,KAAK,EAAE,IAAI,kBAAkB,EAAE,CAAC;YAC5C,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE;gBACZ,sBAAsB,EAAE,GAAG;gBAC3B,WAAW,EAAE;oBACZ,OAAO,EAAE;wBACR,SAAS,EAAE,CAAC;wBACZ,QAAQ,EAAE,CAAC,EAAE;wBACb,kBAAkB,EAAE,IAAI;qBACxB;oBACD,cAAc,EAAE;wBACf,QAAQ,EAAE,CAAC,EAAE;wBACb,IAAI,EAAE,wBAAwB;qBAC9B;iBACD;gBACD,oBAAoB,EAAE,KAAK;gBAC3B,gBAAgB,EAAE,EAAE;gBACpB,kBAAkB,EAAE,EAAE;gBACtB,SAAS,EAAE,CAAC;gBACZ,OAAO,EAAE,KAAK;aACd;YACD,WAAW,EAAE,IAAI;SACjB;QACF,CAAC,CAAC,SAAS,CAAC;AACd,CAAC","sourcesContent":["import path from \"path\";\nimport CssMinimizerPlugin from \"css-minimizer-webpack-plugin\";\nimport type {\n\tEntryObject,\n\tConfiguration as WebpackConfiguration,\n} from \"webpack\";\n\nimport { getPlugins } from \"./getPlugins.js\";\nimport { getRules } from \"./getRules.js\";\nimport { getOutputOptions } from \"./outputOptions.js\";\nimport { type GetConfigOptions, type OutputOptions } from \"./types.js\";\n\n/**\n * Creates the name of an output file.\n *\n * @param postfix The file postfix. Ex. `chunk`\n * @param extension The file extension. Ex. `js`\n * @param options The config options pertaining to hashing and filenaming.\n * @returns The output file name to use.\n */\nexport function getOutputName(\n\tpostfix: string,\n\textension: string,\n\toptions?: OutputOptions,\n): string {\n\tconst { useHash, usePostfix } = getOutputOptions(options);\n\tlet name = \"[name]\";\n\tif (useHash) {\n\t\tname += \".[contenthash]\";\n\t}\n\tif (usePostfix && postfix) {\n\t\tname += \".\" + postfix;\n\t}\n\treturn name + \".\" + extension;\n}\n\n/**\n * Get the webpack configuration.\n *\n * @param entry The entry object to use.\n * @param options The options for the configuration.\n * @returns The webpack configuration.\n */\nexport function getWebpackConfig(\n\tentry?: EntryObject,\n\toptions?: GetConfigOptions,\n): WebpackConfiguration {\n\tconst {\n\t\tadditionalExtensions = [],\n\t\taliases,\n\t\tdevtool = \"source-map\",\n\t\texternalizeReactVendor = false,\n\t\toutputPath = path.resolve(\"dist\"),\n\t} = options ?? {};\n\tconst extensions: string[] = [\n\t\t\".tsx\",\n\t\t\".ts\",\n\t\t\".js\",\n\t\t\".css\",\n\t\t\".scss\",\n\t\t...additionalExtensions,\n\t];\n\tconst resolve: NonNullable<WebpackConfiguration[\"resolve\"]> = {\n\t\textensionAlias: {\n\t\t\t\".js\": [\".js\", \".ts\", \".tsx\"],\n\t\t},\n\t\textensions,\n\t};\n\tif (aliases) {\n\t\tresolve.alias = aliases;\n\t}\n\n\tconst baseConfig: WebpackConfiguration = {\n\t\tdevtool,\n\t\tmodule: {\n\t\t\trules: getRules(options),\n\t\t},\n\t\toutput: {\n\t\t\tchunkFilename: getOutputName(\"chunk\", \"js\", options),\n\t\t\tfilename: getOutputName(\"bundle\", \"js\", options),\n\t\t\tpath: outputPath,\n\t\t},\n\t\tplugins: getPlugins(options),\n\t\tresolve,\n\t};\n\tconst optimization = getOptimizationOptions(options);\n\tif (optimization) {\n\t\tbaseConfig.optimization = optimization;\n\t}\n\tif (entry) {\n\t\tbaseConfig.entry = entry;\n\t}\n\tif (externalizeReactVendor) {\n\t\tbaseConfig.externals = {\n\t\t\t...(baseConfig.externals as Record<string, unknown> | undefined),\n\t\t\t\"@tanstack/react-query\": [\"RootreeVendor\", \"ReactQuery\"],\n\t\t\treact: [\"RootreeVendor\", \"React\"],\n\t\t\t\"react-dom\": [\"RootreeVendor\", \"ReactDOM\"],\n\t\t\t\"react-dom/client\": [\"RootreeVendor\", \"ReactDOMClient\"],\n\t\t};\n\t}\n\treturn baseConfig;\n}\n\n/**\n * Get the options pertaining to optimization.\n *\n * @param options The output options.\n * @returns The optimization settings.\n */\nfunction getOptimizationOptions(\n\toptions?: OutputOptions,\n): WebpackConfiguration[\"optimization\"] {\n\tconst { optimize } = getOutputOptions(options);\n\treturn optimize\n\t\t? {\n\t\t\t\tminimizer: [`...`, new CssMinimizerPlugin()],\n\t\t\t\tsideEffects: true,\n\t\t\t\tsplitChunks: {\n\t\t\t\t\tautomaticNameDelimiter: \"~\",\n\t\t\t\t\tcacheGroups: {\n\t\t\t\t\t\tdefault: {\n\t\t\t\t\t\t\tminChunks: 2,\n\t\t\t\t\t\t\tpriority: -20,\n\t\t\t\t\t\t\treuseExistingChunk: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefaultVendors: {\n\t\t\t\t\t\t\tpriority: -10,\n\t\t\t\t\t\t\ttest: /[\\\\/]node_modules[\\\\/]/,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tenforceSizeThreshold: 50000,\n\t\t\t\t\tmaxAsyncRequests: 30,\n\t\t\t\t\tmaxInitialRequests: 30,\n\t\t\t\t\tminChunks: 1,\n\t\t\t\t\tminSize: 20000,\n\t\t\t\t},\n\t\t\t\tusedExports: true,\n\t\t\t}\n\t\t: undefined;\n}\n"]}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ export type GetConfigOptions = GetPluginsOptions & GetRulesOptions & {
|
|
|
3
3
|
additionalExtensions?: string[];
|
|
4
4
|
aliases?: Record<string, string>;
|
|
5
5
|
devtool?: WebpackConfiguration["devtool"];
|
|
6
|
+
/**
|
|
7
|
+
* Externalize react/react-dom/@tanstack/react-query against
|
|
8
|
+
* `window.RootreeVendor`.
|
|
9
|
+
*/
|
|
10
|
+
externalizeReactVendor?: boolean;
|
|
6
11
|
outputPath?: string;
|
|
7
12
|
};
|
|
8
13
|
export type GetPluginsOptions = OutputOptions & {
|
package/dist/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,aAAa,IAAI,oBAAoB,EACrC,qBAAqB,EACrB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAC/C,eAAe,GAAG;IACjB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC/C,iBAAiB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,aAAa,IAAI,oBAAoB,EACrC,qBAAqB,EACrB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAC/C,eAAe,GAAG;IACjB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC1C;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC/C,iBAAiB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n\tRuleSetRule,\n\tConfiguration as WebpackConfiguration,\n\tWebpackPluginInstance,\n} from \"webpack\";\n\nexport type GetConfigOptions = GetPluginsOptions &\n\tGetRulesOptions & {\n\t\tadditionalExtensions?: string[];\n\t\taliases?: Record<string, string>;\n\t\tdevtool?: WebpackConfiguration[\"devtool\"];\n\t\toutputPath?: string;\n\t};\n\nexport type GetPluginsOptions = OutputOptions & {\n\tadditionalPlugins?: WebpackPluginInstance[];\n};\n\nexport type GetRulesOptions = {\n\tadditionalRules?: RuleSetRule[];\n\texcludedRules?: RegExp[];\n};\n\nexport type OutputOptions = {\n\toptimize?: boolean;\n\tuseHash?: boolean;\n\tusePostfix?: boolean;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n\tRuleSetRule,\n\tConfiguration as WebpackConfiguration,\n\tWebpackPluginInstance,\n} from \"webpack\";\n\nexport type GetConfigOptions = GetPluginsOptions &\n\tGetRulesOptions & {\n\t\tadditionalExtensions?: string[];\n\t\taliases?: Record<string, string>;\n\t\tdevtool?: WebpackConfiguration[\"devtool\"];\n\t\t/**\n\t\t * Externalize react/react-dom/@tanstack/react-query against\n\t\t * `window.RootreeVendor`.\n\t\t */\n\t\texternalizeReactVendor?: boolean;\n\t\toutputPath?: string;\n\t};\n\nexport type GetPluginsOptions = OutputOptions & {\n\tadditionalPlugins?: WebpackPluginInstance[];\n};\n\nexport type GetRulesOptions = {\n\tadditionalRules?: RuleSetRule[];\n\texcludedRules?: RegExp[];\n};\n\nexport type OutputOptions = {\n\toptimize?: boolean;\n\tuseHash?: boolean;\n\tusePostfix?: boolean;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rootreeweb/rt-webpack-helper",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "JavaScript package for generating a standardized WebPack configuration for projects",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": "github:rootreeweb/meta-tools",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"postcss": "8.5.28",
|
|
53
53
|
"postcss-loader": "8.2.1",
|
|
54
54
|
"postcss-media-minmax": "5.0.0",
|
|
55
|
-
"postcss-preset-env": "11.5.
|
|
56
|
-
"sass": "1.104.
|
|
55
|
+
"postcss-preset-env": "11.5.3",
|
|
56
|
+
"sass": "1.104.1",
|
|
57
57
|
"sass-loader": "17.0.1",
|
|
58
58
|
"tailwindcss": "^4.3.3",
|
|
59
59
|
"ts-loader": "9.6.2",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@fontsource/inter": "^5.3.0",
|
|
66
|
-
"@rootreeweb/linting": "^5.1.
|
|
67
|
-
"@rootreeweb/rt-node-lib": "^8.2.
|
|
68
|
-
"@rootreeweb/tsconfigs": "^3.3.
|
|
69
|
-
"@types/node": "^26.5.
|
|
66
|
+
"@rootreeweb/linting": "^5.1.7",
|
|
67
|
+
"@rootreeweb/rt-node-lib": "^8.2.16",
|
|
68
|
+
"@rootreeweb/tsconfigs": "^3.3.21",
|
|
69
|
+
"@types/node": "^26.5.1",
|
|
70
70
|
"@types/webpack-dev-server": "^4.7.2",
|
|
71
71
|
"@typescript/native-preview": "^7.0.0-dev.20260707.2",
|
|
72
72
|
"@vitest/coverage-v8": "^5.0.0",
|
|
@@ -75,14 +75,14 @@
|
|
|
75
75
|
"eslint": "^10.10.0",
|
|
76
76
|
"husky": "^9.1.7",
|
|
77
77
|
"knip": "^6.35.1",
|
|
78
|
-
"lint-staged": "^17.5.
|
|
79
|
-
"memfs": "^4.
|
|
78
|
+
"lint-staged": "^17.5.1",
|
|
79
|
+
"memfs": "^4.78.0",
|
|
80
80
|
"prettier": "~3.8.5",
|
|
81
81
|
"stylelint": "^17.15.0",
|
|
82
82
|
"typescript": "^6.0.3",
|
|
83
|
-
"vite": "^8.
|
|
83
|
+
"vite": "^8.3.0",
|
|
84
84
|
"vitest": "^5.0.0",
|
|
85
|
-
"webpack": "^5.
|
|
85
|
+
"webpack": "^5.111.0",
|
|
86
86
|
"webpack-cli": "^7.2.3"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|