@unpackjs/core 2.4.1 → 2.4.2

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 (195) hide show
  1. package/dist/index.cjs +2028 -196
  2. package/dist/index.js +1876 -39
  3. package/dist/lightningcssLoader.mjs +18 -0
  4. package/dist/typedCssModulesLoader.mjs +139 -0
  5. package/{dist → dist-types}/bundler-config/cache.d.ts +1 -1
  6. package/dist-types/bundler-config/cache.d.ts.map +1 -0
  7. package/{dist → dist-types}/bundler-config/chunkSplit.d.ts +1 -1
  8. package/dist-types/bundler-config/chunkSplit.d.ts.map +1 -0
  9. package/{dist → dist-types}/bundler-config/css.d.ts +1 -1
  10. package/dist-types/bundler-config/css.d.ts.map +1 -0
  11. package/{dist → dist-types}/bundler-config/experimentCss.d.ts +1 -1
  12. package/dist-types/bundler-config/experimentCss.d.ts.map +1 -0
  13. package/{dist → dist-types}/bundler-config/index.d.ts +1 -1
  14. package/dist-types/bundler-config/index.d.ts.map +1 -0
  15. package/{dist/lightningcss/loader.d.ts → dist-types/bundler-config/loaders/lightningcssLoader.d.ts} +2 -2
  16. package/dist-types/bundler-config/loaders/lightningcssLoader.d.ts.map +1 -0
  17. package/dist-types/bundler-config/loaders/typedCssModulesLoader.d.ts +6 -0
  18. package/dist-types/bundler-config/loaders/typedCssModulesLoader.d.ts.map +1 -0
  19. package/{dist/bundler-config → dist-types/bundler-config/plugins}/jsMinify.d.ts +1 -1
  20. package/dist-types/bundler-config/plugins/jsMinify.d.ts.map +1 -0
  21. package/{dist/lightningcss/minimizer.d.ts → dist-types/bundler-config/plugins/lightningcssMinify.d.ts} +2 -3
  22. package/dist-types/bundler-config/plugins/lightningcssMinify.d.ts.map +1 -0
  23. package/{dist/bundler-config/oxlint/plugin.d.ts → dist-types/bundler-config/plugins/oxlint/index.d.ts} +1 -1
  24. package/dist-types/bundler-config/plugins/oxlint/index.d.ts.map +1 -0
  25. package/dist-types/bundler-config/plugins/progress/helpers.d.ts.map +1 -0
  26. package/{dist/bundler-config → dist-types/bundler-config/plugins}/progress/rspack.d.ts +1 -1
  27. package/dist-types/bundler-config/plugins/progress/rspack.d.ts.map +1 -0
  28. package/{dist/bundler-config → dist-types/bundler-config/plugins}/progress/webpack.d.ts +1 -1
  29. package/dist-types/bundler-config/plugins/progress/webpack.d.ts.map +1 -0
  30. package/{dist/typed-css-modules/plugin.d.ts → dist-types/bundler-config/plugins/typedCssModules.d.ts} +2 -2
  31. package/dist-types/bundler-config/plugins/typedCssModules.d.ts.map +1 -0
  32. package/{dist → dist-types}/config.d.ts +1 -1
  33. package/dist-types/config.d.ts.map +1 -0
  34. package/{dist → dist-types}/createUnpack.d.ts +1 -1
  35. package/{dist → dist-types}/createUnpack.d.ts.map +1 -1
  36. package/{dist → dist-types}/index.d.ts +1 -1
  37. package/{dist → dist-types}/index.d.ts.map +1 -1
  38. package/dist-types/logger.d.ts +3 -0
  39. package/{dist → dist-types}/logger.d.ts.map +1 -1
  40. package/{dist → dist-types}/plugin.d.ts +1 -1
  41. package/{dist → dist-types}/plugin.d.ts.map +1 -1
  42. package/dist-types/run/build.d.ts +3 -0
  43. package/{dist → dist-types}/run/build.d.ts.map +1 -1
  44. package/{dist → dist-types}/run/dev.d.ts +1 -1
  45. package/{dist → dist-types}/run/dev.d.ts.map +1 -1
  46. package/{dist → dist-types}/types/config.d.ts +1 -1
  47. package/{dist → dist-types}/types/config.d.ts.map +1 -1
  48. package/{dist → dist-types}/types/index.d.ts +1 -0
  49. package/{dist → dist-types}/types/index.d.ts.map +1 -1
  50. package/{dist → dist-types}/utils.d.ts +5 -1
  51. package/dist-types/utils.d.ts.map +1 -0
  52. package/package.json +6 -37
  53. package/dist/bundler-config/cache.cjs +0 -114
  54. package/dist/bundler-config/cache.d.ts.map +0 -1
  55. package/dist/bundler-config/cache.js +0 -72
  56. package/dist/bundler-config/chunkSplit.cjs +0 -192
  57. package/dist/bundler-config/chunkSplit.d.ts.map +0 -1
  58. package/dist/bundler-config/chunkSplit.js +0 -150
  59. package/dist/bundler-config/css.cjs +0 -189
  60. package/dist/bundler-config/css.d.ts.map +0 -1
  61. package/dist/bundler-config/css.js +0 -149
  62. package/dist/bundler-config/experimentCss.cjs +0 -214
  63. package/dist/bundler-config/experimentCss.d.ts.map +0 -1
  64. package/dist/bundler-config/experimentCss.js +0 -175
  65. package/dist/bundler-config/helpers.cjs +0 -77
  66. package/dist/bundler-config/helpers.js +0 -31
  67. package/dist/bundler-config/index.cjs +0 -309
  68. package/dist/bundler-config/index.d.ts.map +0 -1
  69. package/dist/bundler-config/index.js +0 -262
  70. package/dist/bundler-config/jsMinify.cjs +0 -113
  71. package/dist/bundler-config/jsMinify.d.ts.map +0 -1
  72. package/dist/bundler-config/jsMinify.js +0 -71
  73. package/dist/bundler-config/oxlint/plugin.cjs +0 -143
  74. package/dist/bundler-config/oxlint/plugin.d.ts.map +0 -1
  75. package/dist/bundler-config/oxlint/plugin.js +0 -104
  76. package/dist/bundler-config/progress/helpers.cjs +0 -126
  77. package/dist/bundler-config/progress/helpers.d.ts.map +0 -1
  78. package/dist/bundler-config/progress/helpers.js +0 -81
  79. package/dist/bundler-config/progress/rspack.cjs +0 -70
  80. package/dist/bundler-config/progress/rspack.d.ts.map +0 -1
  81. package/dist/bundler-config/progress/rspack.js +0 -38
  82. package/dist/bundler-config/progress/webpack.cjs +0 -87
  83. package/dist/bundler-config/progress/webpack.d.ts.map +0 -1
  84. package/dist/bundler-config/progress/webpack.js +0 -45
  85. package/dist/colors.cjs +0 -82
  86. package/dist/colors.js +0 -40
  87. package/dist/config.cjs +0 -148
  88. package/dist/config.d.ts.map +0 -1
  89. package/dist/config.js +0 -101
  90. package/dist/constants.cjs +0 -122
  91. package/dist/constants.js +0 -51
  92. package/dist/createUnpack.cjs +0 -107
  93. package/dist/createUnpack.js +0 -75
  94. package/dist/fs.cjs +0 -91
  95. package/dist/fs.js +0 -34
  96. package/dist/global.cjs +0 -36
  97. package/dist/global.js +0 -4
  98. package/dist/lightningcss/loader.cjs +0 -57
  99. package/dist/lightningcss/loader.d.ts.map +0 -1
  100. package/dist/lightningcss/loader.js +0 -25
  101. package/dist/lightningcss/minimizer.cjs +0 -94
  102. package/dist/lightningcss/minimizer.d.ts.map +0 -1
  103. package/dist/lightningcss/minimizer.js +0 -59
  104. package/dist/loadEnv.cjs +0 -122
  105. package/dist/loadEnv.js +0 -80
  106. package/dist/loadingAnimation.cjs +0 -76
  107. package/dist/loadingAnimation.js +0 -44
  108. package/dist/logger.cjs +0 -116
  109. package/dist/logger.d.ts +0 -3
  110. package/dist/logger.js +0 -74
  111. package/dist/openBrowser.cjs +0 -89
  112. package/dist/openBrowser.js +0 -49
  113. package/dist/plugin.cjs +0 -42
  114. package/dist/plugin.js +0 -10
  115. package/dist/prebundleDeps.cjs +0 -349
  116. package/dist/prebundleDeps.js +0 -303
  117. package/dist/progressBar.cjs +0 -66
  118. package/dist/progressBar.js +0 -34
  119. package/dist/reporter.cjs +0 -164
  120. package/dist/reporter.js +0 -120
  121. package/dist/run/build.cjs +0 -68
  122. package/dist/run/build.d.ts +0 -3
  123. package/dist/run/build.js +0 -26
  124. package/dist/run/dev.cjs +0 -118
  125. package/dist/run/dev.js +0 -75
  126. package/dist/run/index.cjs +0 -69
  127. package/dist/run/index.js +0 -4
  128. package/dist/typed-css-modules/loader.cjs +0 -141
  129. package/dist/typed-css-modules/loader.d.ts +0 -8
  130. package/dist/typed-css-modules/loader.d.ts.map +0 -1
  131. package/dist/typed-css-modules/loader.js +0 -92
  132. package/dist/typed-css-modules/plugin.cjs +0 -118
  133. package/dist/typed-css-modules/plugin.d.ts.map +0 -1
  134. package/dist/typed-css-modules/plugin.js +0 -75
  135. package/dist/typed-css-modules/utils.cjs +0 -46
  136. package/dist/typed-css-modules/utils.d.ts +0 -6
  137. package/dist/typed-css-modules/utils.d.ts.map +0 -1
  138. package/dist/typed-css-modules/utils.js +0 -14
  139. package/dist/types/chunkSplit.cjs +0 -18
  140. package/dist/types/chunkSplit.js +0 -2
  141. package/dist/types/config.cjs +0 -18
  142. package/dist/types/config.js +0 -2
  143. package/dist/types/index.cjs +0 -96
  144. package/dist/types/index.js +0 -7
  145. package/dist/types/lightningcss.cjs +0 -18
  146. package/dist/types/lightningcss.js +0 -2
  147. package/dist/types/logger.cjs +0 -45
  148. package/dist/types/logger.js +0 -13
  149. package/dist/types/oxc.cjs +0 -18
  150. package/dist/types/oxc.js +0 -2
  151. package/dist/types/plugin.cjs +0 -18
  152. package/dist/types/plugin.js +0 -2
  153. package/dist/utils.cjs +0 -346
  154. package/dist/utils.d.ts.map +0 -1
  155. package/dist/utils.js +0 -204
  156. package/dist/watchFiles.cjs +0 -69
  157. package/dist/watchFiles.js +0 -27
  158. /package/dist/{bundler-config/oxlint/.oxlintrc.json → .oxlintrc.json} +0 -0
  159. /package/{dist → dist-types}/bundler-config/helpers.d.ts +0 -0
  160. /package/{dist → dist-types}/bundler-config/helpers.d.ts.map +0 -0
  161. /package/{dist/bundler-config → dist-types/bundler-config/plugins}/progress/helpers.d.ts +0 -0
  162. /package/{dist → dist-types}/colors.d.ts +0 -0
  163. /package/{dist → dist-types}/colors.d.ts.map +0 -0
  164. /package/{dist → dist-types}/constants.d.ts +0 -0
  165. /package/{dist → dist-types}/constants.d.ts.map +0 -0
  166. /package/{dist → dist-types}/fs.d.ts +0 -0
  167. /package/{dist → dist-types}/fs.d.ts.map +0 -0
  168. /package/{dist → dist-types}/global.d.ts +0 -0
  169. /package/{dist → dist-types}/global.d.ts.map +0 -0
  170. /package/{dist → dist-types}/loadEnv.d.ts +0 -0
  171. /package/{dist → dist-types}/loadEnv.d.ts.map +0 -0
  172. /package/{dist → dist-types}/loadingAnimation.d.ts +0 -0
  173. /package/{dist → dist-types}/loadingAnimation.d.ts.map +0 -0
  174. /package/{dist → dist-types}/openBrowser.d.ts +0 -0
  175. /package/{dist → dist-types}/openBrowser.d.ts.map +0 -0
  176. /package/{dist → dist-types}/prebundleDeps.d.ts +0 -0
  177. /package/{dist → dist-types}/prebundleDeps.d.ts.map +0 -0
  178. /package/{dist → dist-types}/progressBar.d.ts +0 -0
  179. /package/{dist → dist-types}/progressBar.d.ts.map +0 -0
  180. /package/{dist → dist-types}/reporter.d.ts +0 -0
  181. /package/{dist → dist-types}/reporter.d.ts.map +0 -0
  182. /package/{dist → dist-types}/run/index.d.ts +0 -0
  183. /package/{dist → dist-types}/run/index.d.ts.map +0 -0
  184. /package/{dist → dist-types}/types/chunkSplit.d.ts +0 -0
  185. /package/{dist → dist-types}/types/chunkSplit.d.ts.map +0 -0
  186. /package/{dist → dist-types}/types/lightningcss.d.ts +0 -0
  187. /package/{dist → dist-types}/types/lightningcss.d.ts.map +0 -0
  188. /package/{dist → dist-types}/types/logger.d.ts +0 -0
  189. /package/{dist → dist-types}/types/logger.d.ts.map +0 -0
  190. /package/{dist → dist-types}/types/oxc.d.ts +0 -0
  191. /package/{dist → dist-types}/types/oxc.d.ts.map +0 -0
  192. /package/{dist → dist-types}/types/plugin.d.ts +0 -0
  193. /package/{dist → dist-types}/types/plugin.d.ts.map +0 -0
  194. /package/{dist → dist-types}/watchFiles.d.ts +0 -0
  195. /package/{dist → dist-types}/watchFiles.d.ts.map +0 -0
package/dist/utils.js DELETED
@@ -1,204 +0,0 @@
1
- import 'module';
2
- /*#__PURE__*/ 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__compiled_webpack_merge_index_js_efd91626__ from "../compiled/webpack-merge/index.js";
6
- import node_fs from "node:fs";
7
- import node_net from "node:net";
8
- import node_os from "node:os";
9
- import node_path from "node:path";
10
- import portfinder from "portfinder";
11
- import { colors } from "./colors.js";
12
- import { DEFAULT_DEV_HOST } from "./constants.js";
13
- import { logger } from "./logger.js";
14
- var __webpack_modules__ = {
15
- "../compiled/webpack-merge/index.js": function(module) {
16
- module.exports = __WEBPACK_EXTERNAL_MODULE__compiled_webpack_merge_index_js_efd91626__;
17
- }
18
- };
19
- var __webpack_module_cache__ = {};
20
- function __webpack_require__(moduleId) {
21
- var cachedModule = __webpack_module_cache__[moduleId];
22
- if (void 0 !== cachedModule) return cachedModule.exports;
23
- var module = __webpack_module_cache__[moduleId] = {
24
- exports: {}
25
- };
26
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
27
- return module.exports;
28
- }
29
- var utils_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
30
- const { merge } = __webpack_require__("../compiled/webpack-merge/index.js");
31
- const getNodeEnv = ()=>process.env.NODE_ENV;
32
- const setNodeEnv = (env)=>{
33
- process.env.NODE_ENV = env;
34
- };
35
- const setDevServer = (isDevServer)=>{
36
- process.env.DEV_SERVER = isDevServer ? 'true' : 'false';
37
- };
38
- const isDev = ()=>'development' === getNodeEnv();
39
- const utils_isDevServer = ()=>'true' === process.env.DEV_SERVER;
40
- const isWatch = ()=>isDev() && !utils_isDevServer();
41
- const isProd = ()=>'production' === getNodeEnv();
42
- const isWin = ()=>'win32' === process.platform;
43
- const isString = (str)=>'string' == typeof str;
44
- const isBoolean = (bool)=>'boolean' == typeof bool;
45
- const isUndefined = (obj)=>void 0 === obj;
46
- const isFunction = (func)=>'function' == typeof func;
47
- const isObject = (obj)=>null !== obj && 'object' == typeof obj;
48
- const isPlainObject = (obj)=>isObject(obj) && '[object Object]' === Object.prototype.toString.call(obj);
49
- const isRegExp = (obj)=>'[object RegExp]' === Object.prototype.toString.call(obj);
50
- const prettyTime = (seconds)=>{
51
- const toFixed = (num, len)=>{
52
- const factor = 10 ** len;
53
- return Math.floor(num * factor) / factor;
54
- };
55
- if (seconds < 1) return `${toFixed(1000 * seconds, 0)}ms`;
56
- if (seconds < 60) return `${toFixed(seconds, 2)}s`;
57
- return `${toFixed(seconds / 60, 2)}m`;
58
- };
59
- const getValueByPath = (target, pathArray, defaultValue)=>{
60
- let current = target;
61
- for(let i = 0; i < pathArray.length - 1; i++){
62
- const currKey = pathArray[i];
63
- if (!current[currKey] || 'object' != typeof current[currKey]) current[currKey] = 'string' == typeof pathArray[i + 1] ? {} : [];
64
- current = current[currKey];
65
- }
66
- const lastKey = pathArray.at(-1);
67
- if (void 0 === current[lastKey]) current[lastKey] = defaultValue;
68
- return current[lastKey];
69
- };
70
- const setValueByPath = (target, pathArray, value)=>{
71
- let current = target;
72
- for(let i = 0; i < pathArray.length - 1; i++){
73
- const currKey = pathArray[i];
74
- if (!current[currKey] || 'object' != typeof current[currKey]) current[currKey] = 'string' == typeof pathArray[i + 1] ? {} : [];
75
- current = current[currKey];
76
- }
77
- current[pathArray.at(-1)] = value;
78
- };
79
- const getPort = (startPort = 45678)=>new Promise((resolve)=>{
80
- portfinder.getPort({
81
- port: startPort
82
- }, (_, port)=>{
83
- resolve(port);
84
- });
85
- });
86
- const getCompiledPkgPath = (packageName)=>node_path.join(utils_dirname, '../compiled', packageName);
87
- const getUserDepPath = (root, deps)=>{
88
- const dependencies = Array.isArray(deps) ? deps : [
89
- deps
90
- ];
91
- for (const dep of dependencies){
92
- const absPath = node_path.resolve(root, 'node_modules', dep);
93
- if (node_fs.existsSync(absPath)) return absPath;
94
- }
95
- };
96
- function getTime() {
97
- const now = new Date();
98
- const hours = String(now.getHours()).padStart(2, '0');
99
- const minutes = String(now.getMinutes()).padStart(2, '0');
100
- const seconds = String(now.getSeconds()).padStart(2, '0');
101
- return `${hours}:${minutes}:${seconds}`;
102
- }
103
- const debounce = (fn, delay)=>{
104
- let timer = null;
105
- return (...args)=>{
106
- clearTimeout(timer);
107
- timer = setTimeout(()=>{
108
- fn(...args);
109
- }, delay);
110
- };
111
- };
112
- const getIpv4Interfaces = ()=>{
113
- const interfaces = node_os.networkInterfaces();
114
- const ipv4Interfaces = new Map();
115
- for (const key of Object.keys(interfaces))for (const detail of interfaces[key]){
116
- const familyV4Value = 'string' == typeof detail.family ? 'IPv4' : 4;
117
- if (detail.family === familyV4Value && !ipv4Interfaces.has(detail.address)) ipv4Interfaces.set(detail.address, detail);
118
- }
119
- return Array.from(ipv4Interfaces.values());
120
- };
121
- const isLoopbackHost = (host)=>{
122
- const loopbackHosts = [
123
- 'localhost',
124
- '127.0.0.1',
125
- '::1',
126
- '0000:0000:0000:0000:0000:0000:0000:0001'
127
- ];
128
- return loopbackHosts.includes(host);
129
- };
130
- const getHostInUrl = (host)=>{
131
- if (node_net.isIPv6(host)) return '::' === host ? '[::1]' : `[${host}]`;
132
- return host;
133
- };
134
- const concatUrl = ({ host, port, protocol })=>`${protocol}://${host}:${port}/`;
135
- const LOCAL_LABEL = 'Local: ';
136
- const NETWORK_LABEL = 'Network: ';
137
- const getAddressUrls = ({ protocol = 'http', port, host })=>{
138
- if (host && host !== DEFAULT_DEV_HOST) return [
139
- {
140
- label: isLoopbackHost(host) ? LOCAL_LABEL : NETWORK_LABEL,
141
- url: concatUrl({
142
- port,
143
- host: getHostInUrl(host),
144
- protocol
145
- })
146
- }
147
- ];
148
- const ipv4Interfaces = getIpv4Interfaces();
149
- const addressUrls = [];
150
- let hasLocalUrl = false;
151
- for (const detail of ipv4Interfaces)if (isLoopbackHost(detail.address) || detail.internal) {
152
- if (hasLocalUrl) continue;
153
- addressUrls.push({
154
- label: LOCAL_LABEL,
155
- url: concatUrl({
156
- host: 'localhost',
157
- port,
158
- protocol
159
- })
160
- });
161
- hasLocalUrl = true;
162
- } else addressUrls.push({
163
- label: NETWORK_LABEL,
164
- url: concatUrl({
165
- host: detail.address,
166
- port,
167
- protocol
168
- })
169
- });
170
- return addressUrls;
171
- };
172
- const trackPerformance = (msg)=>{
173
- const k = '__unpack_last_track_time';
174
- if (!global[k]) {
175
- global[k] = performance.now();
176
- return;
177
- }
178
- if (msg) logger.wait(`${msg} ${colors.dim('for')} ${colors.yellow(`${(performance.now() - global[k]).toFixed(2)}ms`)}`);
179
- global[k] = performance.now();
180
- };
181
- const getPathInJs = (absPath)=>JSON.stringify(absPath).slice(1, -1);
182
- const mergeConfig = merge;
183
- const getUserDepVersion = (root, dep)=>{
184
- const depPath = getUserDepPath(root, dep);
185
- if (!depPath) return;
186
- const packageInfo = JSON.parse(node_fs.readFileSync(node_path.resolve(depPath, 'package.json'), 'utf-8'));
187
- return packageInfo.version;
188
- };
189
- const clearLine = ()=>{
190
- if (!process.stdout.isTTY) return;
191
- process.stdout.clearLine(0);
192
- process.stdout.cursorTo(0);
193
- };
194
- const logUpdate = (output)=>{
195
- clearLine();
196
- process.stdout.write(output);
197
- };
198
- const isDebug = ()=>'unpack' === process.env.DEBUG;
199
- const isCI = ()=>!!process.env.CI;
200
- function isNodeVersionAtLeast(major, minor) {
201
- const [currMajor, currMinor] = process.versions.node.split('.').map(Number);
202
- return currMajor > major || currMajor === major && currMinor >= minor;
203
- }
204
- export { clearLine, debounce, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isCI, isDebug, isDev, utils_isDevServer as isDevServer, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isProd, isRegExp, isString, isUndefined, isWatch, isWin, logUpdate, mergeConfig, prettyTime, setDevServer, setNodeEnv, setValueByPath, trackPerformance };
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.d = (exports1, definition)=>{
14
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
- enumerable: true,
16
- get: definition[key]
17
- });
18
- };
19
- })();
20
- (()=>{
21
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
- })();
23
- (()=>{
24
- __webpack_require__.r = (exports1)=>{
25
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
- value: 'Module'
27
- });
28
- Object.defineProperty(exports1, '__esModule', {
29
- value: true
30
- });
31
- };
32
- })();
33
- var __webpack_exports__ = {};
34
- __webpack_require__.r(__webpack_exports__);
35
- __webpack_require__.d(__webpack_exports__, {
36
- createChokidar: ()=>createChokidar
37
- });
38
- const external_chokidar_namespaceObject = require("chokidar");
39
- var external_chokidar_default = /*#__PURE__*/ __webpack_require__.n(external_chokidar_namespaceObject);
40
- const external_tinyglobby_namespaceObject = require("tinyglobby");
41
- const GLOB_REGEX = /[*?{}[\]()!@+|]/;
42
- const isGlob = (str)=>GLOB_REGEX.test(str);
43
- async function createChokidar(pathOrGlobs, root = process.cwd(), options) {
44
- const watchFiles = new Set();
45
- const globPatterns = pathOrGlobs.filter((pathOrGlob)=>{
46
- if (isGlob(pathOrGlob)) return true;
47
- watchFiles.add(pathOrGlob);
48
- return false;
49
- });
50
- if (globPatterns.length) {
51
- const files = await (0, external_tinyglobby_namespaceObject.glob)(globPatterns, {
52
- cwd: root,
53
- absolute: true
54
- });
55
- for (const file of files)watchFiles.add(file);
56
- }
57
- return external_chokidar_default().watch(Array.from(watchFiles), {
58
- ignoreInitial: true,
59
- ignorePermissionErrors: true,
60
- ...options
61
- });
62
- }
63
- exports.createChokidar = __webpack_exports__.createChokidar;
64
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
65
- "createChokidar"
66
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
67
- Object.defineProperty(exports, '__esModule', {
68
- value: true
69
- });
@@ -1,27 +0,0 @@
1
- import 'module';
2
- /*#__PURE__*/ import.meta.url;
3
- import chokidar from "chokidar";
4
- import { glob } from "tinyglobby";
5
- const GLOB_REGEX = /[*?{}[\]()!@+|]/;
6
- const isGlob = (str)=>GLOB_REGEX.test(str);
7
- async function createChokidar(pathOrGlobs, root = process.cwd(), options) {
8
- const watchFiles = new Set();
9
- const globPatterns = pathOrGlobs.filter((pathOrGlob)=>{
10
- if (isGlob(pathOrGlob)) return true;
11
- watchFiles.add(pathOrGlob);
12
- return false;
13
- });
14
- if (globPatterns.length) {
15
- const files = await glob(globPatterns, {
16
- cwd: root,
17
- absolute: true
18
- });
19
- for (const file of files)watchFiles.add(file);
20
- }
21
- return chokidar.watch(Array.from(watchFiles), {
22
- ignoreInitial: true,
23
- ignorePermissionErrors: true,
24
- ...options
25
- });
26
- }
27
- export { createChokidar };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes