@reckona/mreact-router 0.0.102 → 0.0.103

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/build.js CHANGED
@@ -3401,11 +3401,12 @@ async function collectBuildFiles(projectRoot, allowedSourceDirs, appDir) {
3401
3401
  const files = {};
3402
3402
  for (const directory of allowedSourceDirs) {
3403
3403
  const sourceFiles = (await collectFiles(directory)).flatMap((file) => {
3404
- if (isAppFileConventionAsset(file, appDir)) {
3405
- return [];
3406
- }
3407
3404
  const relativeFile = relative(projectRoot, file);
3408
- if (relativeFile === "" || relativeFile.startsWith("..") || relativeFile.startsWith(sep)) {
3405
+ if (relativeFile === "" ||
3406
+ relativeFile.startsWith("..") ||
3407
+ relativeFile.startsWith(sep) ||
3408
+ isAppFileConventionAsset(file, appDir) ||
3409
+ isProductionBuildIgnoredSourceFile(relativeFile)) {
3409
3410
  return [];
3410
3411
  }
3411
3412
  return [{ file, relativeFile }];
@@ -3420,6 +3421,9 @@ async function collectBuildFiles(projectRoot, allowedSourceDirs, appDir) {
3420
3421
  }
3421
3422
  return files;
3422
3423
  }
3424
+ function isProductionBuildIgnoredSourceFile(relativeFile) {
3425
+ return /(?:^|[/\\])[^/\\]+\.(?:spec|test)\.[cm]?[jt]sx?$/u.test(relativeFile);
3426
+ }
3423
3427
  function isAppFileConventionAsset(file, appDir) {
3424
3428
  const relativeFile = relative(appDir, file);
3425
3429
  if (relativeFile === "" || relativeFile.startsWith("..") || relativeFile.includes(sep)) {