Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@
"@osd/test": "1.0.0",
"@osd/test-subj-selector": "0.2.1",
"@osd/utility-types": "1.0.0",
"@rsdoctor/rspack-plugin": "^1.3.11",
"@rspack/cli": "1.7.11",
"@rspack/core": "1.7.11",
"@rsdoctor/rspack-plugin": "1.5.13",
"@rspack/cli": "2.0.8",
"@rspack/core": "2.0.8",
"@swc/helpers": "^0.5.21",
"@tailwindcss/postcss": "4.2.4",
"@testing-library/dom": "^8.11.3",
Expand Down

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion packages/osd-optimizer/src/worker/run_compilers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ const observeCompiler = (
if (workerConfig.profileWebpack) {
Fs.writeFileSync(
Path.resolve(bundle.outputDir, 'stats.json'),
JSON.stringify(stats.toJson())
JSON.stringify(
stats.toJson({
assets: true,
chunks: true,
chunkGroups: true,
entrypoints: true,
modules: true,
})
)
);
}

Expand Down
63 changes: 32 additions & 31 deletions packages/osd-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,45 +105,39 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
name: bundle.id,
mode: worker.dist ? 'production' : 'development',
context: Path.normalize(bundle.contextDir),
cache: true,
...(worker.cache
cache: worker.cache
? {
experiments: {
cache: {
type: 'persistent',
buildDependencies: [
__filename,
require.resolve('./theme_loader'),
require.resolve('./entry_point_creator'),
require.resolve('@osd/optimizer/postcss.config.js'),
Path.resolve(worker.repoRoot, '.browserslistrc'),
],
// Isolate caches when config that affects build output changes
version: JSON.stringify({
themeTags: worker.themeTags,
browserslistEnv: worker.browserslistEnv,
}),
snapshot: {
// Workspace-symlinked packages that are imported by plugin bundles
// must use content-hash validation instead of package.json version.
// Only @osd/* is entirely workspace-local; the others have specific
// symlinked packages alongside real npm packages in the same scope.
unmanagedPaths: [
/[\\/]node_modules[\\/]@osd[\\/]/,
/[\\/]node_modules[\\/]@elastic[\\/]safer-lodash-set[\\/]/,
/[\\/]node_modules[\\/]@opensearch[\\/]datemath[\\/]/,
],
},
},
type: 'persistent',
buildDependencies: [
__filename,
require.resolve('./theme_loader'),
require.resolve('./entry_point_creator'),
require.resolve('@osd/optimizer/postcss.config.js'),
Path.resolve(worker.repoRoot, '.browserslistrc'),
],
// Isolate caches when config that affects build output changes
version: JSON.stringify({
themeTags: worker.themeTags,
browserslistEnv: worker.browserslistEnv,
}),
snapshot: {
// Workspace-symlinked packages that are imported by plugin bundles
// must use content-hash validation instead of package.json version.
// Only @osd/* is entirely workspace-local; the others have specific
// symlinked packages alongside real npm packages in the same scope.
unmanagedPaths: [
/[\\/]node_modules[\\/]@osd[\\/]/,
/[\\/]node_modules[\\/]@elastic[\\/]safer-lodash-set[\\/]/,
/[\\/]node_modules[\\/]@opensearch[\\/]datemath[\\/]/,
],
},
}
: {}),
: true,
entry: {
[bundle.id]: ENTRY_CREATOR,
},

devtool: worker.dist ? false : 'cheap-module-source-map',
profile: worker.profileWebpack,

output: {
path: bundle.outputDir,
Expand Down Expand Up @@ -203,6 +197,13 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
],

module: {
parser: {
javascript: {
// Rspack 2.0 changed the default from 'warn' to 'error'.
// Preserve the old behavior to avoid breaking builds on non-existent exports.
exportsPresence: 'auto',
},
},
// no parse rules for a few known large packages which have no require() statements
// or which have require() statements that should be ignored because the file is
// already bundled with all its necessary depedencies
Expand Down
4 changes: 3 additions & 1 deletion packages/osd-pm/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ module.exports = {
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'commonjs2',
library: {
type: 'commonjs2',
},
hashFunction: 'xxhash64',
},

Expand Down
1 change: 1 addition & 0 deletions packages/osd-ui-shared-deps/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const Fs = require('fs');

const { run, createFailError, CiStatsReporter } = require('@osd/dev-utils');
// const webpack = require('webpack');
// eslint-disable-next-line import/no-unresolved
const { rspack } = require('@rspack/core');
// const Stats = require('webpack/lib/Stats');
const del = require('del');
Expand Down
1 change: 1 addition & 0 deletions packages/osd-ui-shared-deps/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const Path = require('path');
const CompressionPlugin = require('compression-webpack-plugin');
const { REPO_ROOT } = require('@osd/utils');
// const webpack = require('webpack');
// eslint-disable-next-line import/no-unresolved
const { rspack } = require('@rspack/core');
const { getSwcLoaderConfig } = require('@osd/utils');

Expand Down
Loading
Loading