Skip to content
Merged
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@backstage/cli": "0.34.1",
"@backstage/cli-common": "^0.1.15",
"@backstage/cli-common": "^0.1.17",
"@backstage/cli-node": "^0.2.12",
"@backstage/config": "^1.3.2",
"@backstage/config-loader": "^1.9.5",
Expand Down Expand Up @@ -80,7 +80,7 @@
"style-loader": "^3.3.1",
"swc-loader": "^0.2.3",
"typescript-json-schema": "^0.64.0",
"webpack": "~5.96.0",
"webpack": "~5.104.1",
"webpack-dev-server": "^5.0.0",
"yaml": "^2.5.1",
"yml-loader": "^2.1.0",
Expand Down
31 changes: 30 additions & 1 deletion src/lib/bundler/LinkedPackageResolvePlugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,42 @@
* limitations under the License.
*/

import * as fs from 'node:fs';
import * as os from 'os';
import * as path from 'path';

import { LinkedPackageResolvePlugin } from './LinkedPackageResolvePlugin';

describe('LinkedPackageResolvePlugin', () => {
const root = os.platform() === 'win32' ? 'C:\\root' : '/root';
// Use a temp dir so isChildPath (realpathSync) can access paths; /root may be inaccessible (EACCES).
const root = path.join(
os.tmpdir(),
`linked-package-resolve-plugin-test-${Date.now()}`,
);

beforeAll(() => {
const dirs = [
path.join(root, 'external-a'),
path.join(root, 'external-a/src'),
path.join(root, 'external-b'),
path.join(root, 'external-b/src'),
path.join(root, 'external-aa'),
path.join(root, 'external-aa/src'),
path.join(root, 'repo/package/x/src'),
path.join(root, 'repo/node_modules'),
];
for (const dir of dirs) {
fs.mkdirSync(dir, { recursive: true });
}
});

afterAll(() => {
try {
fs.rmSync(root, { recursive: true });
} catch {
// ignore cleanup errors
}
});

it('should re-write paths for external packages', () => {
const plugin = new LinkedPackageResolvePlugin(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bundler/optimization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const optimization = (
format: 'iife',
}),
],
runtimeChunk: 'single',
runtimeChunk: { name: _ => 'runtime' },
splitChunks: {
automaticNameDelimiter: '-',
cacheGroups: {
Expand Down
Loading