@meteorjs/rspack 0.0.25 → 0.0.27

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  const ctx = import.meta.webpackContext('/', {
3
3
  recursive: true,
4
- regExp: /\.app-?(?:test|spec)s?\.[^.]+$/,
4
+ regExp: /\.app-(?:test|spec)s?\.[^.]+$/,
5
5
  exclude: /(^|\/)(node_modules|\.meteor|_build)(\/|$)/,
6
6
  mode: 'eager',
7
7
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meteorjs/rspack",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "Configuration logic for using Rspack in Meteor projects",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/rspack.config.js CHANGED
@@ -120,16 +120,16 @@ export default function (inMeteor = {}, argv = {}) {
120
120
  }
121
121
  }
122
122
 
123
- const isProd = Meteor.isProduction || argv.mode === 'production';
124
- const isDev = Meteor.isDevelopment || !isProd;
125
- const isTest = Meteor.isTest;
126
- const isClient = Meteor.isClient;
127
- const isRun = Meteor.isRun;
128
- const isReactEnabled = Meteor.isReactEnabled;
129
- const isTestModule = Meteor.isTestModule;
130
- const isTestEager = Meteor.isTestEager;
131
- const isTestFullApp = Meteor.isTestFullApp;
132
- const swcExternalHelpers = Meteor.swcExternalHelpers;
123
+ const isProd = !!Meteor.isProduction || argv.mode === 'production';
124
+ const isDev = !!Meteor.isDevelopment || !isProd;
125
+ const isTest = !!Meteor.isTest;
126
+ const isClient = !!Meteor.isClient;
127
+ const isRun = !!Meteor.isRun;
128
+ const isReactEnabled = !!Meteor.isReactEnabled;
129
+ const isTestModule = !!Meteor.isTestModule;
130
+ const isTestEager = !!Meteor.isTestEager;
131
+ const isTestFullApp = !!Meteor.isTestFullApp;
132
+ const swcExternalHelpers = !!Meteor.swcExternalHelpers;
133
133
  const mode = isProd ? 'production' : 'development';
134
134
 
135
135
  const isTypescriptEnabled = Meteor.isTypescriptEnabled || false;
@@ -351,9 +351,9 @@ export default function (inMeteor = {}, argv = {}) {
351
351
 
352
352
  const serverEntry =
353
353
  isTest && isTestEager && isTestFullApp
354
- ? 'node_modules/@meteorjs/rspack/entries/eager-app-tests.js'
354
+ ? path.resolve(process.cwd(), 'node_modules/@meteorjs/rspack/entries/eager-app-tests.js')
355
355
  : isTest && isTestEager
356
- ? 'node_modules/@meteorjs/rspack/entries/eager-tests.js'
356
+ ? path.resolve(process.cwd(), 'node_modules/@meteorjs/rspack/entries/eager-tests.js')
357
357
  : path.resolve(process.cwd(), buildContext, entryPath);
358
358
  const serverNameConfig = `[${(isTest && 'test-') || ''}${
359
359
  (isTestModule && 'module') || 'server'
@@ -368,8 +368,9 @@ export default function (inMeteor = {}, argv = {}) {
368
368
  path: serverOutputDir,
369
369
  filename: () => `../${buildContext}/${outputPath}`,
370
370
  libraryTarget: 'commonjs',
371
- chunkFilename: `${bundlesContext}/[id].[chunkhash].js`,
371
+ chunkFilename: `${bundlesContext}/[id]${isProd ? '.[chunkhash]' : ''}.js`,
372
372
  assetModuleFilename: `${assetsContext}/[hash][ext][query]`,
373
+ clean: isProd,
373
374
  },
374
375
  optimization: { usedExports: true },
375
376
  module: {