@unpackjs/core 3.9.0 → 3.9.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/dist/index.js CHANGED
@@ -528,7 +528,12 @@ let removeDir = (dir)=>{
528
528
  recursive: !0,
529
529
  force: !0
530
530
  });
531
- }, STYLE_IMPORT_RE = /import\s+([\s\S]+?)\s+from\s+(['"])(.*?\.(?:css|less|scss|sass))\2/g, BROWSER_LOGS_ENDPOINT = '/__browser_logs__', browserLogs_SCRIPT_REGEX = /\.(js|jsx|mjs|cjs|ts|tsx|mts|cts|vue|svelte)$/, gzip = promisify(node_zlib.gzip), numberFormatter = new Intl.NumberFormat('en', {
531
+ }, STYLE_IMPORT_RE = /import\s+([\s\S]+?)\s+from\s+(['"])(.*?\.(?:css|less|scss|sass))\2/g, TYPE_IMPORT_CLAUSE_RE = /^\s*type\b/, STYLE_EXT_HINTS = [
532
+ '.css',
533
+ '.less',
534
+ '.scss',
535
+ '.sass'
536
+ ], BROWSER_LOGS_ENDPOINT = '/__browser_logs__', browserLogs_SCRIPT_REGEX = /\.(js|jsx|mjs|cjs|ts|tsx|mts|cts|vue|svelte)$/, gzip = promisify(node_zlib.gzip), numberFormatter = new Intl.NumberFormat('en', {
532
537
  maximumFractionDigits: 2,
533
538
  minimumFractionDigits: 2
534
539
  }), displaySize = (bytes)=>`${numberFormatter.format(bytes / 1000)} kB`;
@@ -749,7 +754,7 @@ class JsMinifyPlugin {
749
754
  apply(compiler) {
750
755
  let meta = JSON.stringify({
751
756
  name: jsMinify_PLUGIN_NAME,
752
- version: "3.9.0",
757
+ version: "3.9.1",
753
758
  options: this.minifyOptions
754
759
  });
755
760
  compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
@@ -1581,7 +1586,7 @@ async function unpackDev(unpackConfig) {
1581
1586
  ...middlewares
1582
1587
  ]);
1583
1588
  let server = new RspackDevServer(devServerOptions, compiler);
1584
- await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v3.9.0${unpackConfig.performance?.cache ? ' ϟ' : ''}`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
1589
+ await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v3.9.1${unpackConfig.performance?.cache ? ' ϟ' : ''}`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
1585
1590
  port,
1586
1591
  host: unpackConfig.server.host,
1587
1592
  base: unpackConfig.base
@@ -1595,7 +1600,7 @@ async function unpackDev(unpackConfig) {
1595
1600
  function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'unpack' }) {
1596
1601
  let _context = {
1597
1602
  callerName,
1598
- version: "3.9.0",
1603
+ version: "3.9.1",
1599
1604
  cachePath: 'node_modules/.unpack'
1600
1605
  }, resolveConfig = (mode)=>{
1601
1606
  let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, root;
@@ -1639,7 +1644,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
1639
1644
  filter: {
1640
1645
  test: JSX_REGEX
1641
1646
  },
1642
- handler: (code)=>code.replace(STYLE_IMPORT_RE, (full, importClause, quote, spec)=>'string' == typeof importClause && /^\s*type\b/.test(importClause) || spec.includes('?') || spec.includes('#') ? full : `import ${importClause} from ${quote}${spec}?module${quote}`)
1647
+ handler: (code)=>STYLE_EXT_HINTS.some((ext)=>code.includes(ext)) ? code.replace(STYLE_IMPORT_RE, (full, importClause, quote, spec)=>TYPE_IMPORT_CLAUSE_RE.test(importClause) || spec.includes('?') || spec.includes('#') ? full : `import ${importClause} from ${quote}${spec}?module${quote}`) : null
1643
1648
  }
1644
1649
  },
1645
1650
  (rootPath = '', outputPath = '', basePath = '/', cachedTraceMap = new Map(), fs = null, isValidMethodName = (methodName)=>'<unknown>' !== methodName && !/[\\/]/.test(methodName), parseFrame = async (frame)=>{
@@ -2265,7 +2270,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
2265
2270
  let mode = watch ? 'development' : 'production';
2266
2271
  setNodeEnv(mode);
2267
2272
  let config = resolveConfig(mode);
2268
- console.log(colors.brand(`${callerName} v3.9.0${config.performance?.cache ? ' ϟ' : ''}`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
2273
+ console.log(colors.brand(`${callerName} v3.9.1${config.performance?.cache ? ' ϟ' : ''}`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
2269
2274
  },
2270
2275
  dev: async ()=>{
2271
2276
  setUnpackStartTime(performance.now());
@@ -1 +1 @@
1
- {"version":3,"file":"autoCssModules.d.ts","sourceRoot":"","sources":["../../src/plugins/autoCssModules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAI7C,eAAO,MAAM,oBAAoB,QAAO,YAmBvC,CAAA"}
1
+ {"version":3,"file":"autoCssModules.d.ts","sourceRoot":"","sources":["../../src/plugins/autoCssModules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAM7C,eAAO,MAAM,oBAAoB,QAAO,YAoBvC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prebundle.d.ts","sourceRoot":"","sources":["../../src/plugins/prebundle.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,WAAW,CAAA;AAkGnE,eAAO,MAAM,eAAe,QAAO,YA+YlC,CAAA"}
1
+ {"version":3,"file":"prebundle.d.ts","sourceRoot":"","sources":["../../src/plugins/prebundle.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,WAAW,CAAA;AAkGnE,eAAO,MAAM,eAAe,QAAO,YA8YlC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unpackjs/core",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "An Rspack-based build tool",
5
5
  "type": "module",
6
6
  "exports": {
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@jridgewell/trace-mapping": "0.3.31",
39
- "@rsdoctor/rspack-plugin": "1.4.0",
39
+ "@rsdoctor/rspack-plugin": "1.5.0",
40
40
  "@rspack/core": "1.7.2",
41
41
  "@rspack/dev-server": "1.1.5",
42
42
  "chokidar": "5.0.0",