@meteorjs/rspack 1.1.0-beta.3 → 1.1.0-beta.5

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/lib/ignore.js CHANGED
@@ -117,7 +117,7 @@ function createIgnoreRegex(globPatterns) {
117
117
 
118
118
  // For absolute paths, we don't want to force the pattern to match from the beginning
119
119
  // but we still want to ensure it matches to the end of the path segment
120
- regexPattern = '(?:^|/)' + regexPattern + '$';
120
+ regexPattern = '(?:^|/)' + regexPattern + (pattern.endsWith('*') ? '' : '$');
121
121
 
122
122
  return regexPattern;
123
123
  }).filter(pattern => pattern !== null);
package/lib/test.js CHANGED
@@ -43,9 +43,9 @@ const generateEagerTestFile = ({
43
43
  createIgnoreGlobConfig(ignoreEntries)
44
44
  );
45
45
  // Create regex from meteor ignore entries
46
- const excludeMeteorIgnoreRegex = createIgnoreRegex(
47
- createIgnoreGlobConfig(inMeteorIgnoreEntries)
48
- );
46
+ const excludeMeteorIgnoreRegex = inMeteorIgnoreEntries.length > 0
47
+ ? createIgnoreRegex(createIgnoreGlobConfig(inMeteorIgnoreEntries))
48
+ : null;
49
49
 
50
50
  const prefix = (inPrefix && `${inPrefix}-`) || "";
51
51
  const filename = isAppTest
@@ -58,9 +58,12 @@ const generateEagerTestFile = ({
58
58
 
59
59
  const content = `${
60
60
  globalImportPath ? `import '${globalImportPath}';\n\n` : ""
61
+ }${
62
+ excludeMeteorIgnoreRegex
63
+ ? `const MeteorIgnoreRegex = ${excludeMeteorIgnoreRegex.toString()};`
64
+ : ""
61
65
  }
62
- const MeteorIgnoreRegex = ${excludeMeteorIgnoreRegex.toString()};
63
- {
66
+ {
64
67
  const ctx = import.meta.webpackContext('${projectDir}', {
65
68
  recursive: true,
66
69
  regExp: ${regExp},
@@ -68,13 +71,12 @@ const generateEagerTestFile = ({
68
71
  mode: 'eager',
69
72
  });
70
73
  ctx.keys().filter((k) => {
71
- // Make the check strictly relative to the context root.
72
- // If k is absolute and starts with root, strip it; if it's already relative, leave it.
73
- const rel = k.startsWith('${projectDir}') ? k.slice(${
74
- projectDir.length
75
- }) : k.replace(/^\\.\\//, '');
76
- // Only exclude based on *relative* path segments.
77
- return !MeteorIgnoreRegex.test(rel);
74
+ ${
75
+ excludeMeteorIgnoreRegex
76
+ ? `// Only exclude based on *relative* path segments.
77
+ return !MeteorIgnoreRegex.test(k);`
78
+ : "return true;"
79
+ }
78
80
  }).forEach(ctx);
79
81
  ${
80
82
  extraEntry
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meteorjs/rspack",
3
- "version": "1.1.0-beta.3",
3
+ "version": "1.1.0-beta.5",
4
4
  "description": "Configuration logic for using Rspack in Meteor projects",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
package/rspack.config.js CHANGED
@@ -454,11 +454,6 @@ module.exports = async function (inMeteor = {}, argv = {}) {
454
454
  : isClient && isTest && testEntry
455
455
  ? path.resolve(process.cwd(), testEntry)
456
456
  : path.resolve(process.cwd(), buildContext, entryPath);
457
- console.log(
458
- "--> (rspack.config.js-Line: 431)\n clientEntry: ",
459
- clientEntry,
460
- entryPath
461
- );
462
457
  const clientNameConfig = `[${(isTest && 'test-') || ''}client-rspack]`;
463
458
  // Base client config
464
459
  let clientConfig = {
@@ -581,11 +576,6 @@ module.exports = async function (inMeteor = {}, argv = {}) {
581
576
  ? path.resolve(process.cwd(), testEntry)
582
577
  : path.resolve(projectDir, buildContext, entryPath);
583
578
  const serverNameConfig = `[${(isTest && 'test-') || ''}server-rspack]`;
584
- console.log(
585
- "--> (rspack.config.js-Line: 576)\n serverEntry: ",
586
- serverEntry,
587
- entryPath
588
- );
589
579
  // Base server config
590
580
  let serverConfig = {
591
581
  name: serverNameConfig,