mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
test the new rspack.config.override.<ext> config to apply overrides against all config
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// CustomConsoleLogPlugin.js
|
||||
class CustomConsoleLogPlugin {
|
||||
apply(compiler) {
|
||||
compiler.hooks.beforeRun.tap('CustomConsoleLogPlugin', (compilation) => {
|
||||
console.log('👉 [CustomConsoleLogPlugin] Build is starting...');
|
||||
});
|
||||
|
||||
compiler.hooks.done.tap('CustomConsoleLogPlugin', (stats) => {
|
||||
console.log('✅ [CustomConsoleLogPlugin] Build finished successfully!');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CustomConsoleLogPlugin;
|
||||
@@ -0,0 +1,10 @@
|
||||
const { defineConfig } = require("@meteorjs/rspack");
|
||||
const CustomConsoleLogPlugin = require('./plugins/CustomConsoleLogPlugin')
|
||||
|
||||
module.exports = defineConfig((Meteor) => {
|
||||
return {
|
||||
plugins: [
|
||||
new CustomConsoleLogPlugin()
|
||||
],
|
||||
};
|
||||
});
|
||||
14
tools/modern-tests/apps/react-router/plugins/CustomConsoleLogPlugin.js
vendored
Normal file
14
tools/modern-tests/apps/react-router/plugins/CustomConsoleLogPlugin.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// CustomConsoleLogPlugin.js
|
||||
class CustomConsoleLogPlugin {
|
||||
apply(compiler) {
|
||||
compiler.hooks.beforeRun.tap('CustomConsoleLogPlugin', (compilation) => {
|
||||
console.log('👉 [CustomConsoleLogPlugin] Build is starting...');
|
||||
});
|
||||
|
||||
compiler.hooks.done.tap('CustomConsoleLogPlugin', (stats) => {
|
||||
console.log('✅ [CustomConsoleLogPlugin] Build finished successfully!');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CustomConsoleLogPlugin;
|
||||
@@ -0,0 +1,10 @@
|
||||
const { defineConfig } = require("@meteorjs/rspack");
|
||||
const CustomConsoleLogPlugin = require('./plugins/CustomConsoleLogPlugin')
|
||||
|
||||
module.exports = defineConfig((Meteor) => {
|
||||
return {
|
||||
plugins: [
|
||||
new CustomConsoleLogPlugin()
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -23,14 +23,26 @@ describe('Monorepo App Bundling /', () => {
|
||||
],
|
||||
configFile: 'rspack.config.cjs',
|
||||
customAssertions: {
|
||||
afterRun: async ({ result }) => {
|
||||
// Check custom plugin gets loaded from rspack.config.override.cjs file
|
||||
await waitForMeteorOutput(result.outputLines, /.*CustomConsoleLogPlugin.*/);
|
||||
},
|
||||
afterRunRebuildClient: async ({ allConsoleLogs }) => {
|
||||
// Check for HMR output as enabled by default
|
||||
// Check custom plugin gets loaded from rspack.config.override.cjs file
|
||||
await waitForMeteorOutput(allConsoleLogs, /.*HMR.*Updated modules:.*/);
|
||||
},
|
||||
afterRunProductionRebuildClient: async ({ allConsoleLogs }) => {
|
||||
// Check for HMR to not be enabled in production-like mode
|
||||
await waitForMeteorOutput(allConsoleLogs, /.*HMR.*Updated modules:*/, { negate: true });
|
||||
},
|
||||
afterTest: async ({ result }) => {
|
||||
// Check custom plugin gets loaded from rspack.config.override.cjs file
|
||||
await waitForMeteorOutput(result.outputLines, /.*CustomConsoleLogPlugin.*/);
|
||||
},
|
||||
afterBuild: async ({ result }) => {
|
||||
// Check custom plugin gets loaded from rspack.config.override.cjs file
|
||||
await waitForMeteorOutput(result.outputLines, /.*CustomConsoleLogPlugin.*/);
|
||||
},
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -53,6 +53,8 @@ describe('ReactRouter App Bundling /', () => {
|
||||
await waitForMeteorOutput(result.outputLines, /.*custom-package loaded.*/);
|
||||
// resolve.extensions loading
|
||||
await waitForMeteorOutput(result.outputLines, /.*first\.jsx loaded.*/);
|
||||
// Check custom plugin gets loaded from rspack.config.override.js file
|
||||
await waitForMeteorOutput(result.outputLines, /.*CustomConsoleLogPlugin.*/);
|
||||
},
|
||||
afterRunRebuildClient: async ({ allConsoleLogs }) => {
|
||||
// Check for HMR output as enabled by default
|
||||
@@ -81,6 +83,8 @@ describe('ReactRouter App Bundling /', () => {
|
||||
},
|
||||
afterTest: async ({ result }) => {
|
||||
await waitForReactEnvs(result.outputLines);
|
||||
// Check custom plugin gets loaded from rspack.config.override.js file
|
||||
await waitForMeteorOutput(result.outputLines, /.*CustomConsoleLogPlugin.*/);
|
||||
},
|
||||
afterTestOnce: async ({ result }) => {
|
||||
await waitForReactEnvs(result.outputLines);
|
||||
@@ -88,6 +92,8 @@ describe('ReactRouter App Bundling /', () => {
|
||||
afterBuild: async ({ result }) => {
|
||||
await waitForReactEnvs(result.outputLines, { isTsxEnabled: true });
|
||||
await waitForMeteorOutput(result.outputLines, /.*babel-plugin-react-compiler.*/);
|
||||
// Check custom plugin gets loaded from rspack.config.override.js file
|
||||
await waitForMeteorOutput(result.outputLines, /.*CustomConsoleLogPlugin.*/);
|
||||
},
|
||||
}
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user