@unpackjs/core 1.7.5 → 1.7.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.
Files changed (122) hide show
  1. package/compiled/css-loader/index.js +180 -178
  2. package/compiled/less-loader/index.js +11 -11
  3. package/compiled/line-diff/index.js +4 -4
  4. package/compiled/portfinder/index.js +37 -37
  5. package/compiled/postcss-loader/index.js +261 -256
  6. package/compiled/sass-loader/index.js +18 -18
  7. package/compiled/semver/index.js +188 -170
  8. package/compiled/semver/package.json +1 -1
  9. package/compiled/style-loader/index.js +13 -13
  10. package/compiled/webpack-bundle-analyzer/index.js +198 -198
  11. package/compiled/webpack-merge/index.js +29 -29
  12. package/dist/bundler-config/chunkSplit.cjs +169 -156
  13. package/dist/bundler-config/chunkSplit.d.ts +1 -1
  14. package/dist/bundler-config/chunkSplit.js +125 -134
  15. package/dist/bundler-config/css.cjs +181 -158
  16. package/dist/bundler-config/css.d.ts +1 -1
  17. package/dist/bundler-config/css.js +139 -151
  18. package/dist/bundler-config/experimentCss.cjs +203 -159
  19. package/dist/bundler-config/experimentCss.d.ts +1 -1
  20. package/dist/bundler-config/experimentCss.js +162 -152
  21. package/dist/bundler-config/helper.cjs +82 -78
  22. package/dist/bundler-config/helper.js +36 -55
  23. package/dist/bundler-config/index.cjs +260 -209
  24. package/dist/bundler-config/index.d.ts +1 -1
  25. package/dist/bundler-config/index.d.ts.map +1 -1
  26. package/dist/bundler-config/index.js +209 -182
  27. package/dist/bundler-config/jsMinify.cjs +114 -95
  28. package/dist/bundler-config/jsMinify.js +70 -73
  29. package/dist/colors.cjs +83 -56
  30. package/dist/colors.js +38 -37
  31. package/dist/config.cjs +107 -93
  32. package/dist/config.d.ts +1 -1
  33. package/dist/config.d.ts.map +1 -1
  34. package/dist/config.js +64 -70
  35. package/dist/constants.cjs +62 -62
  36. package/dist/constants.js +20 -38
  37. package/dist/createUnpack.cjs +111 -104
  38. package/dist/createUnpack.js +67 -82
  39. package/dist/global.cjs +36 -0
  40. package/dist/global.d.ts +2 -0
  41. package/dist/global.d.ts.map +1 -0
  42. package/dist/global.js +4 -0
  43. package/dist/index.cjs +174 -51
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +33 -15
  47. package/dist/lightningcss/cache.cjs +40 -32
  48. package/dist/lightningcss/cache.js +10 -20
  49. package/dist/lightningcss/loader.cjs +56 -53
  50. package/dist/lightningcss/loader.d.ts +1 -1
  51. package/dist/lightningcss/loader.js +25 -34
  52. package/dist/lightningcss/minimizer.cjs +90 -109
  53. package/dist/lightningcss/minimizer.d.ts +1 -1
  54. package/dist/lightningcss/minimizer.js +59 -87
  55. package/dist/logger.cjs +104 -98
  56. package/dist/logger.d.ts +1 -1
  57. package/dist/logger.js +59 -76
  58. package/dist/openBrowser.cjs +104 -81
  59. package/dist/openBrowser.js +56 -52
  60. package/dist/plugin-progress/rspack.cjs +104 -79
  61. package/dist/plugin-progress/rspack.d.ts +1 -1
  62. package/dist/plugin-progress/rspack.js +59 -57
  63. package/dist/plugin-progress/webpack.cjs +111 -89
  64. package/dist/plugin-progress/webpack.d.ts +1 -1
  65. package/dist/plugin-progress/webpack.js +65 -67
  66. package/dist/plugin.cjs +38 -29
  67. package/dist/plugin.js +8 -17
  68. package/dist/prebundleDeps.cjs +327 -337
  69. package/dist/prebundleDeps.d.ts.map +1 -1
  70. package/dist/prebundleDeps.js +278 -324
  71. package/dist/progressBar.cjs +82 -65
  72. package/dist/progressBar.js +38 -43
  73. package/dist/reporter.cjs +135 -120
  74. package/dist/reporter.js +88 -98
  75. package/dist/run/build.cjs +68 -67
  76. package/dist/run/build.d.ts +1 -1
  77. package/dist/run/build.js +24 -45
  78. package/dist/run/dev.cjs +96 -83
  79. package/dist/run/dev.d.ts +1 -1
  80. package/dist/run/dev.d.ts.map +1 -1
  81. package/dist/run/dev.js +50 -61
  82. package/dist/run/index.cjs +74 -21
  83. package/dist/run/index.js +2 -9
  84. package/dist/typed-css-modules/loader.cjs +179 -188
  85. package/dist/typed-css-modules/loader.d.ts +1 -1
  86. package/dist/typed-css-modules/loader.js +118 -151
  87. package/dist/typed-css-modules/plugin.cjs +113 -88
  88. package/dist/typed-css-modules/plugin.d.ts +1 -1
  89. package/dist/typed-css-modules/plugin.js +68 -66
  90. package/dist/typed-css-modules/utils.cjs +43 -42
  91. package/dist/typed-css-modules/utils.d.ts +1 -1
  92. package/dist/typed-css-modules/utils.js +13 -30
  93. package/dist/types/chunkSplit.cjs +19 -15
  94. package/dist/types/chunkSplit.d.ts +2 -10
  95. package/dist/types/chunkSplit.d.ts.map +1 -1
  96. package/dist/types/chunkSplit.js +2 -9
  97. package/dist/types/config.cjs +19 -15
  98. package/dist/types/config.d.ts +1 -1
  99. package/dist/types/config.js +2 -9
  100. package/dist/types/index.cjs +101 -27
  101. package/dist/types/index.js +2 -9
  102. package/dist/types/lightningcss.cjs +19 -15
  103. package/dist/types/lightningcss.js +2 -9
  104. package/dist/types/logger.cjs +43 -34
  105. package/dist/types/logger.js +13 -22
  106. package/dist/types/plugin.cjs +19 -15
  107. package/dist/types/plugin.js +2 -9
  108. package/dist/utils.cjs +280 -304
  109. package/dist/utils.js +195 -241
  110. package/dist/watchFiles.cjs +73 -0
  111. package/dist/watchFiles.d.ts +3 -0
  112. package/dist/watchFiles.d.ts.map +1 -0
  113. package/dist/watchFiles.js +27 -0
  114. package/package.json +14 -17
  115. package/compiled/commander/index.d.ts +0 -1047
  116. package/compiled/commander/index.js +0 -2428
  117. package/compiled/commander/license +0 -22
  118. package/compiled/commander/package.json +0 -1
  119. package/dist/bundleRequire.cjs +0 -200
  120. package/dist/bundleRequire.d.ts +0 -5
  121. package/dist/bundleRequire.d.ts.map +0 -1
  122. package/dist/bundleRequire.js +0 -173
@@ -1,160 +1,170 @@
1
- import { createRequire } from 'node:module';
2
- var require = createRequire(import.meta['url']);
3
-
4
- import path from "path";
5
- import { fileURLToPath } from "url";
6
- var getFilename = () => fileURLToPath(import.meta.url);
7
- var getDirname = () => path.dirname(getFilename());
8
- var __dirname = /* @__PURE__ */ getDirname();
9
- var __filename = /* @__PURE__ */ getFilename();
10
- import path2 from "node:path";
11
- import {
12
- CSS_MODULES_LOCAL_IDENT_NAME,
13
- CSS_MODULES_REGEX,
14
- CSS_NAMED_EXPORT,
15
- EXPORT_LOCALS_CONVENTION,
16
- THREAD_OPTIONS
17
- } from "../constants.js";
18
- import { PluginTypedCssModules } from "../typed-css-modules/plugin.js";
19
- import {
20
- getCompiledPkgPath,
21
- getUserDepPath,
22
- isDev,
23
- isFunction,
24
- isPlainObject,
25
- isRegExp,
26
- mergeConfig,
27
- setValueByPath
28
- } from "../utils.js";
29
- import { getOutputFilename } from "./helper.js";
30
- function applyExperimentCssConfig({
31
- config,
32
- unpackConfig
33
- }) {
34
- const CSS_FILENAME = getOutputFilename({ type: "css", hash: unpackConfig.build?.filenameHash });
35
- config.output.cssFilename = CSS_FILENAME;
36
- config.output.cssChunkFilename = CSS_FILENAME;
37
- setValueByPath(config, ["experiments", "css"], true);
38
- let modules = unpackConfig.css?.modules;
39
- if (!isPlainObject(modules) && modules !== false)
40
- modules = {};
41
- if (modules !== false && modules.auto !== false) {
42
- setValueByPath(config, ["module", "parser", "css/module"], {
43
- namedExports: CSS_NAMED_EXPORT
1
+ import __rslib_shim_module__ from 'module';
2
+ const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
3
+ import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
4
+ import { dirname as __webpack_dirname__ } from "node:path";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__ from "../constants.js";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__typed_css_modules_plugin_js_c181893e__ from "../typed-css-modules/plugin.js";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__ from "../utils.js";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__helper_js_3f3fef5c__ from "./helper.js";
10
+ var experimentCss_rslib_entry_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
11
+ function applyExperimentCssConfig({ config, unpackConfig }) {
12
+ var _unpackConfig_build, _unpackConfig_css, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
13
+ const CSS_FILENAME = (0, __WEBPACK_EXTERNAL_MODULE__helper_js_3f3fef5c__.getOutputFilename)({
14
+ type: 'css',
15
+ hash: null === (_unpackConfig_build = unpackConfig.build) || void 0 === _unpackConfig_build ? void 0 : _unpackConfig_build.filenameHash
44
16
  });
45
- setValueByPath(config, ["module", "generator", "css/module"], {
46
- localIdentName: modules.localIdentName || CSS_MODULES_LOCAL_IDENT_NAME,
47
- exportsConvention: EXPORT_LOCALS_CONVENTION
48
- });
49
- }
50
- const withCssModules = ({ use }) => {
51
- if (modules === false)
52
- return false;
53
- const auto = modules.auto;
54
- if (auto === false)
55
- return false;
56
- return {
57
- test: (resourcePath) => {
58
- if (resourcePath.includes("node_modules"))
59
- return CSS_MODULES_REGEX.test(resourcePath);
60
- if (isRegExp(auto))
61
- return auto.test(resourcePath);
62
- if (isFunction(auto))
63
- return auto(resourcePath);
64
- return CSS_MODULES_REGEX.test(resourcePath);
65
- },
66
- use,
67
- type: "css/module"
17
+ config.output.cssFilename = CSS_FILENAME;
18
+ config.output.cssChunkFilename = CSS_FILENAME;
19
+ (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.setValueByPath)(config, [
20
+ 'experiments',
21
+ 'css'
22
+ ], true);
23
+ let modules = null === (_unpackConfig_css = unpackConfig.css) || void 0 === _unpackConfig_css ? void 0 : _unpackConfig_css.modules;
24
+ if (!(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isPlainObject)(modules) && false !== modules) modules = {};
25
+ if (false !== modules && false !== modules.auto) {
26
+ (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.setValueByPath)(config, [
27
+ 'module',
28
+ 'parser',
29
+ 'css/module'
30
+ ], {
31
+ namedExports: __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.CSS_NAMED_EXPORT
32
+ });
33
+ (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.setValueByPath)(config, [
34
+ 'module',
35
+ 'generator',
36
+ 'css/module'
37
+ ], {
38
+ localIdentName: modules.localIdentName || __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.CSS_MODULES_LOCAL_IDENT_NAME,
39
+ exportsConvention: __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.EXPORT_LOCALS_CONVENTION
40
+ });
41
+ }
42
+ const withCssModules = ({ use })=>{
43
+ if (false === modules) return false;
44
+ const auto = modules.auto;
45
+ if (false === auto) return false;
46
+ return {
47
+ test: (resourcePath)=>{
48
+ if (resourcePath.includes('node_modules')) return __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.CSS_MODULES_REGEX.test(resourcePath);
49
+ if ((0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isRegExp)(auto)) return auto.test(resourcePath);
50
+ if ((0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isFunction)(auto)) return auto(resourcePath);
51
+ return __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.CSS_MODULES_REGEX.test(resourcePath);
52
+ },
53
+ use,
54
+ type: 'css/module'
55
+ };
68
56
  };
69
- };
70
- const getThreadLoader = () => {
71
- return unpackConfig.build?.parallel && {
72
- loader: require.resolve("thread-loader"),
73
- options: THREAD_OPTIONS
57
+ const getThreadLoader = ()=>{
58
+ var _unpackConfig_build;
59
+ return (null === (_unpackConfig_build = unpackConfig.build) || void 0 === _unpackConfig_build ? void 0 : _unpackConfig_build.parallel) && {
60
+ loader: require.resolve('thread-loader'),
61
+ options: __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.THREAD_OPTIONS
62
+ };
74
63
  };
75
- };
76
- const getLessLoader = () => {
77
- return {
78
- loader: getCompiledPkgPath("less-loader"),
79
- options: {
80
- lessOptions: mergeConfig(
81
- {
82
- javascriptEnabled: true
83
- },
84
- unpackConfig.css?.less || {}
85
- ),
86
- implementation: getUserDepPath(unpackConfig.root, "less"),
87
- sourceMap: unpackConfig.css?.sourceMap
88
- }
64
+ const getLessLoader = ()=>{
65
+ var _unpackConfig_css, _unpackConfig_css1;
66
+ return {
67
+ loader: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getCompiledPkgPath)('less-loader'),
68
+ options: {
69
+ lessOptions: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.mergeConfig)({
70
+ javascriptEnabled: true
71
+ }, (null === (_unpackConfig_css = unpackConfig.css) || void 0 === _unpackConfig_css ? void 0 : _unpackConfig_css.less) || {}),
72
+ implementation: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getUserDepPath)(unpackConfig.root, 'less'),
73
+ sourceMap: null === (_unpackConfig_css1 = unpackConfig.css) || void 0 === _unpackConfig_css1 ? void 0 : _unpackConfig_css1.sourceMap
74
+ }
75
+ };
89
76
  };
90
- };
91
- config.module?.rules?.push({
92
- test: /\.less$/i,
93
- // @ts-expect-error
94
- oneOf: [
95
- withCssModules({ use: [getThreadLoader(), getLessLoader()].filter(Boolean) }),
96
- {
97
- use: [getThreadLoader(), getLessLoader()].filter(Boolean),
98
- type: "css"
99
- }
100
- ].filter(Boolean)
101
- });
102
- const getLightningcssLoader = () => {
103
- return {
104
- loader: path2.resolve(__dirname, "../lightningcss/loader.cjs"),
105
- options: mergeConfig(unpackConfig.css?.lightningcss || {}, {
106
- sourceMap: unpackConfig.css?.sourceMap
107
- })
77
+ null === (_config_module = config.module) || void 0 === _config_module || null === (_config_module_rules = _config_module.rules) || void 0 === _config_module_rules || _config_module_rules.push({
78
+ test: /\.less$/i,
79
+ oneOf: [
80
+ withCssModules({
81
+ use: [
82
+ getThreadLoader(),
83
+ getLessLoader()
84
+ ].filter(Boolean)
85
+ }),
86
+ {
87
+ use: [
88
+ getThreadLoader(),
89
+ getLessLoader()
90
+ ].filter(Boolean),
91
+ type: 'css'
92
+ }
93
+ ].filter(Boolean)
94
+ });
95
+ const getLightningcssLoader = ()=>{
96
+ var _unpackConfig_css, _unpackConfig_css1;
97
+ return {
98
+ loader: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(experimentCss_rslib_entry_dirname, '../lightningcss/loader.cjs'),
99
+ options: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.mergeConfig)((null === (_unpackConfig_css = unpackConfig.css) || void 0 === _unpackConfig_css ? void 0 : _unpackConfig_css.lightningcss) || {}, {
100
+ sourceMap: null === (_unpackConfig_css1 = unpackConfig.css) || void 0 === _unpackConfig_css1 ? void 0 : _unpackConfig_css1.sourceMap
101
+ })
102
+ };
108
103
  };
109
- };
110
- const getPostcssLoader = () => {
111
- return {
112
- loader: getCompiledPkgPath("postcss-loader"),
113
- options: {
114
- postcssOptions: unpackConfig.css?.postcss,
115
- sourceMap: unpackConfig.css?.sourceMap
116
- }
104
+ const getPostcssLoader = ()=>{
105
+ var _unpackConfig_css, _unpackConfig_css1;
106
+ return {
107
+ loader: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getCompiledPkgPath)('postcss-loader'),
108
+ options: {
109
+ postcssOptions: null === (_unpackConfig_css = unpackConfig.css) || void 0 === _unpackConfig_css ? void 0 : _unpackConfig_css.postcss,
110
+ sourceMap: null === (_unpackConfig_css1 = unpackConfig.css) || void 0 === _unpackConfig_css1 ? void 0 : _unpackConfig_css1.sourceMap
111
+ }
112
+ };
117
113
  };
118
- };
119
- const getCssLoader = () => {
120
- return unpackConfig.css?.transformer === "lightningcss" ? getLightningcssLoader() : getPostcssLoader();
121
- };
122
- config.module?.rules?.push({
123
- test: /\.css$/i,
124
- // @ts-expect-error
125
- oneOf: [
126
- withCssModules({ use: [getCssLoader()] }),
127
- {
128
- use: [getCssLoader()],
129
- type: "css"
130
- }
131
- ].filter(Boolean)
132
- });
133
- const getSassLoader = () => {
134
- return {
135
- loader: getCompiledPkgPath("sass-loader"),
136
- options: {
137
- api: "modern-compiler",
138
- implementation: getUserDepPath(unpackConfig.root, ["sass-embedded", "sass"]),
139
- sassOptions: unpackConfig.css?.sass,
140
- sourceMap: unpackConfig.css?.sourceMap
141
- }
114
+ const getCssLoader = ()=>{
115
+ var _unpackConfig_css;
116
+ return (null === (_unpackConfig_css = unpackConfig.css) || void 0 === _unpackConfig_css ? void 0 : _unpackConfig_css.transformer) === 'lightningcss' ? getLightningcssLoader() : getPostcssLoader();
142
117
  };
143
- };
144
- config.module?.rules?.push({
145
- test: /\.s[ac]ss$/i,
146
- // @ts-expect-error
147
- oneOf: [
148
- withCssModules({ use: [getSassLoader()] }),
149
- {
150
- use: [getSassLoader()],
151
- type: "css"
152
- }
153
- ].filter(Boolean)
154
- });
155
- isDev() && config.plugins.push(new PluginTypedCssModules({ modules }));
156
- return config;
118
+ null === (_config_module1 = config.module) || void 0 === _config_module1 || null === (_config_module_rules1 = _config_module1.rules) || void 0 === _config_module_rules1 || _config_module_rules1.push({
119
+ test: /\.css$/i,
120
+ oneOf: [
121
+ withCssModules({
122
+ use: [
123
+ getCssLoader()
124
+ ]
125
+ }),
126
+ {
127
+ use: [
128
+ getCssLoader()
129
+ ],
130
+ type: 'css'
131
+ }
132
+ ].filter(Boolean)
133
+ });
134
+ const getSassLoader = ()=>{
135
+ var _unpackConfig_css, _unpackConfig_css1;
136
+ return {
137
+ loader: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getCompiledPkgPath)('sass-loader'),
138
+ options: {
139
+ api: 'modern-compiler',
140
+ implementation: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getUserDepPath)(unpackConfig.root, [
141
+ 'sass-embedded',
142
+ 'sass'
143
+ ]),
144
+ sassOptions: null === (_unpackConfig_css = unpackConfig.css) || void 0 === _unpackConfig_css ? void 0 : _unpackConfig_css.sass,
145
+ sourceMap: null === (_unpackConfig_css1 = unpackConfig.css) || void 0 === _unpackConfig_css1 ? void 0 : _unpackConfig_css1.sourceMap
146
+ }
147
+ };
148
+ };
149
+ null === (_config_module2 = config.module) || void 0 === _config_module2 || null === (_config_module_rules2 = _config_module2.rules) || void 0 === _config_module_rules2 || _config_module_rules2.push({
150
+ test: /\.s[ac]ss$/i,
151
+ oneOf: [
152
+ withCssModules({
153
+ use: [
154
+ getSassLoader()
155
+ ]
156
+ }),
157
+ {
158
+ use: [
159
+ getSassLoader()
160
+ ],
161
+ type: 'css'
162
+ }
163
+ ].filter(Boolean)
164
+ });
165
+ (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isDev)() && config.plugins.push(new __WEBPACK_EXTERNAL_MODULE__typed_css_modules_plugin_js_c181893e__.PluginTypedCssModules({
166
+ modules
167
+ }));
168
+ return config;
157
169
  }
158
- export {
159
- applyExperimentCssConfig
160
- };
170
+ export { applyExperimentCssConfig };
@@ -1,83 +1,87 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var helper_exports = {};
29
- __export(helper_exports, {
30
- getEntry: () => getEntry,
31
- getOutputFilename: () => getOutputFilename
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = function(module) {
5
+ var getter = module && module.__esModule ? function() {
6
+ return module['default'];
7
+ } : function() {
8
+ return module;
9
+ };
10
+ __webpack_require__.d(getter, {
11
+ a: getter
12
+ });
13
+ return getter;
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.d = function(exports1, definition) {
18
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
19
+ enumerable: true,
20
+ get: definition[key]
21
+ });
22
+ };
23
+ })();
24
+ (()=>{
25
+ __webpack_require__.o = function(obj, prop) {
26
+ return Object.prototype.hasOwnProperty.call(obj, prop);
27
+ };
28
+ })();
29
+ (()=>{
30
+ __webpack_require__.r = function(exports1) {
31
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
32
+ value: 'Module'
33
+ });
34
+ Object.defineProperty(exports1, '__esModule', {
35
+ value: true
36
+ });
37
+ };
38
+ })();
39
+ var __webpack_exports__ = {};
40
+ __webpack_require__.r(__webpack_exports__);
41
+ __webpack_require__.d(__webpack_exports__, {
42
+ getEntry: ()=>getEntry,
43
+ getOutputFilename: ()=>getOutputFilename
32
44
  });
33
- module.exports = __toCommonJS(helper_exports);
34
- var import_node_fs = __toESM(require("node:fs"));
35
- var import_node_path = __toESM(require("node:path"));
36
- var import_utils = require("../utils.cjs");
37
- var import_tinyglobby = require("tinyglobby");
38
- var import_constants = require("../constants.cjs");
39
- var import_logger = require("../logger.cjs");
45
+ const external_node_fs_namespaceObject = require("node:fs");
46
+ var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
47
+ const external_node_path_namespaceObject = require("node:path");
48
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
49
+ const external_utils_cjs_namespaceObject = require("../utils.cjs");
50
+ const external_tinyglobby_namespaceObject = require("tinyglobby");
51
+ const external_constants_cjs_namespaceObject = require("../constants.cjs");
52
+ const external_logger_cjs_namespaceObject = require("../logger.cjs");
40
53
  async function getEntry(root, customEntry) {
41
- let entry = void 0;
42
- if (!customEntry) {
43
- const files = await (0, import_tinyglobby.glob)("(index|Index).{js,ts,jsx,tsx}", {
44
- cwd: import_node_path.default.join(root, "src"),
45
- absolute: true
46
- });
47
- entry = files[0];
48
- } else {
49
- entry = import_node_path.default.resolve(root, customEntry);
50
- }
51
- if (!import_node_fs.default.existsSync(entry)) {
52
- import_logger.logger.error(new Error("Could not find entry file"));
53
- process.exit(1);
54
- }
55
- return entry;
56
- }
57
- const getOutputFilename = ({ type, hash }) => {
58
- const mode = (0, import_utils.isDev)() || hash === false ? "development" : "production";
59
- const handles = {
60
- js: {
61
- development: () => {
62
- return import_constants.DEV_DEFAULT_FILENAME.js;
63
- },
64
- production: () => {
65
- return import_constants.PROD_DEFAULT_FILENAME.js;
66
- }
67
- },
68
- css: {
69
- development: () => {
70
- return import_constants.DEV_DEFAULT_FILENAME.css;
71
- },
72
- production: () => {
73
- return import_constants.PROD_DEFAULT_FILENAME.css;
74
- }
54
+ let entry;
55
+ if (customEntry) entry = external_node_path_default().resolve(root, customEntry);
56
+ else {
57
+ const files = await (0, external_tinyglobby_namespaceObject.glob)('(index|Index).{js,ts,jsx,tsx}', {
58
+ cwd: external_node_path_default().join(root, 'src'),
59
+ absolute: true
60
+ });
61
+ entry = files[0];
75
62
  }
76
- };
77
- return handles[type][mode]();
63
+ if (!external_node_fs_default().existsSync(entry)) {
64
+ external_logger_cjs_namespaceObject.logger.error(new Error('Could not find entry file'));
65
+ process.exit(1);
66
+ }
67
+ return entry;
68
+ }
69
+ const getOutputFilename = ({ type, hash })=>{
70
+ const mode = (0, external_utils_cjs_namespaceObject.isDev)() || false === hash ? 'development' : 'production';
71
+ const handles = {
72
+ js: {
73
+ development: ()=>external_constants_cjs_namespaceObject.DEV_DEFAULT_FILENAME.js,
74
+ production: ()=>external_constants_cjs_namespaceObject.PROD_DEFAULT_FILENAME.js
75
+ },
76
+ css: {
77
+ development: ()=>external_constants_cjs_namespaceObject.DEV_DEFAULT_FILENAME.css,
78
+ production: ()=>external_constants_cjs_namespaceObject.PROD_DEFAULT_FILENAME.css
79
+ }
80
+ };
81
+ return handles[type][mode]();
78
82
  };
79
- // Annotate the CommonJS export names for ESM import in node:
80
- 0 && (module.exports = {
81
- getEntry,
82
- getOutputFilename
83
+ var __webpack_export_target__ = exports;
84
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
85
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
86
+ value: true
83
87
  });
@@ -1,58 +1,39 @@
1
- import { createRequire } from 'node:module';
2
- var require = createRequire(import.meta['url']);
3
-
4
- import path from "path";
5
- import { fileURLToPath } from "url";
6
- var getFilename = () => fileURLToPath(import.meta.url);
7
- var getDirname = () => path.dirname(getFilename());
8
- var __dirname = /* @__PURE__ */ getDirname();
9
- var __filename = /* @__PURE__ */ getFilename();
10
- import fs from "node:fs";
11
- import path2 from "node:path";
12
- import { isDev } from "../utils.js";
13
- import { glob } from "tinyglobby";
14
- import { DEV_DEFAULT_FILENAME, PROD_DEFAULT_FILENAME } from "../constants.js";
15
- import { logger } from "../logger.js";
1
+ import __rslib_shim_module__ from 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__ from "../utils.js";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_tinyglobby__ from "tinyglobby";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__ from "../constants.js";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__ from "../logger.js";
16
9
  async function getEntry(root, customEntry) {
17
- let entry = void 0;
18
- if (!customEntry) {
19
- const files = await glob("(index|Index).{js,ts,jsx,tsx}", {
20
- cwd: path2.join(root, "src"),
21
- absolute: true
22
- });
23
- entry = files[0];
24
- } else {
25
- entry = path2.resolve(root, customEntry);
26
- }
27
- if (!fs.existsSync(entry)) {
28
- logger.error(new Error("Could not find entry file"));
29
- process.exit(1);
30
- }
31
- return entry;
32
- }
33
- const getOutputFilename = ({ type, hash }) => {
34
- const mode = isDev() || hash === false ? "development" : "production";
35
- const handles = {
36
- js: {
37
- development: () => {
38
- return DEV_DEFAULT_FILENAME.js;
39
- },
40
- production: () => {
41
- return PROD_DEFAULT_FILENAME.js;
42
- }
43
- },
44
- css: {
45
- development: () => {
46
- return DEV_DEFAULT_FILENAME.css;
47
- },
48
- production: () => {
49
- return PROD_DEFAULT_FILENAME.css;
50
- }
10
+ let entry;
11
+ if (customEntry) entry = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(root, customEntry);
12
+ else {
13
+ const files = await (0, __WEBPACK_EXTERNAL_MODULE_tinyglobby__.glob)('(index|Index).{js,ts,jsx,tsx}', {
14
+ cwd: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(root, 'src'),
15
+ absolute: true
16
+ });
17
+ entry = files[0];
51
18
  }
52
- };
53
- return handles[type][mode]();
54
- };
55
- export {
56
- getEntry,
57
- getOutputFilename
19
+ if (!__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(entry)) {
20
+ __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.error(new Error('Could not find entry file'));
21
+ process.exit(1);
22
+ }
23
+ return entry;
24
+ }
25
+ const getOutputFilename = ({ type, hash })=>{
26
+ const mode = (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isDev)() || false === hash ? 'development' : 'production';
27
+ const handles = {
28
+ js: {
29
+ development: ()=>__WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.DEV_DEFAULT_FILENAME.js,
30
+ production: ()=>__WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.PROD_DEFAULT_FILENAME.js
31
+ },
32
+ css: {
33
+ development: ()=>__WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.DEV_DEFAULT_FILENAME.css,
34
+ production: ()=>__WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.PROD_DEFAULT_FILENAME.css
35
+ }
36
+ };
37
+ return handles[type][mode]();
58
38
  };
39
+ export { getEntry, getOutputFilename };