From 93621caedf57c1b791619412f81d1bedc3b0fb2d Mon Sep 17 00:00:00 2001 From: mingxuanzhang Date: Thu, 31 Oct 2024 15:16:19 -0700 Subject: [PATCH] ci: disallow dynamic imports --- .../esbuild.config.js | 10 ++++++++-- .../esbuild.config.js | 10 ++++++++-- packages/salesforcedx-vscode-apex/esbuild.config.js | 10 ++++++++-- packages/salesforcedx-vscode-core/esbuild.config.js | 8 +++++++- .../salesforcedx-vscode-lightning/esbuild.config.js | 10 ++++++++-- packages/salesforcedx-vscode-lwc/esbuild.config.js | 8 +++++++- packages/salesforcedx-vscode-soql/esbuild.config.js | 10 ++++++++-- 7 files changed, 54 insertions(+), 12 deletions(-) diff --git a/packages/salesforcedx-vscode-apex-debugger/esbuild.config.js b/packages/salesforcedx-vscode-apex-debugger/esbuild.config.js index 131b703409..1419d99248 100644 --- a/packages/salesforcedx-vscode-apex-debugger/esbuild.config.js +++ b/packages/salesforcedx-vscode-apex-debugger/esbuild.config.js @@ -21,7 +21,13 @@ const sharedConfig = { ], plugins: [ esbuildPluginPino({ transports: ['pino-pretty'] }) - ] + ], + supported: { + 'dynamic-import': false + }, + logOverride: { + 'unsupported-dynamic-import': 'error' + } }; // copy core-bundle/lib/transformStream.js to dist if core-bundle is included @@ -46,4 +52,4 @@ const destPath = './dist/transformStream.js'; }); })().then(async () => { await copyFiles(srcPath, destPath); -}).catch(() => process.exit(1)); \ No newline at end of file +}).catch(() => process.exit(1)); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js b/packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js index 196671d425..da9253b9ba 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js +++ b/packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js @@ -22,7 +22,13 @@ const sharedConfig = { keepNames: true, plugins: [ esbuildPluginPino({ transports: ['pino-pretty'] }) - ] + ], + supported: { + 'dynamic-import': false + }, + logOverride: { + 'unsupported-dynamic-import': 'error' + } }; // copy core-bundle/lib/transformStream.js to dist if core-bundle is included @@ -47,4 +53,4 @@ const destPath = './dist/transformStream.js'; }); })().then(async () => { await copyFiles(srcPath, destPath); -}).catch(() => process.exit(1)); \ No newline at end of file +}).catch(() => process.exit(1)); diff --git a/packages/salesforcedx-vscode-apex/esbuild.config.js b/packages/salesforcedx-vscode-apex/esbuild.config.js index 177e7f3931..62023332f6 100644 --- a/packages/salesforcedx-vscode-apex/esbuild.config.js +++ b/packages/salesforcedx-vscode-apex/esbuild.config.js @@ -23,7 +23,13 @@ const sharedConfig = { plugins: [ esbuildPluginPino({ transports: ['pino-pretty'] }) ], - minify: true + minify: true, + supported: { + 'dynamic-import': false + }, + logOverride: { + 'unsupported-dynamic-import': 'error' + } }; // copy core-bundle/lib/transformStream.js to dist if core-bundle is included @@ -48,4 +54,4 @@ const destPath = './dist/transformStream.js'; }); })().then(async () => { await copyFiles(srcPath, destPath); -}).catch(() => process.exit(1)); \ No newline at end of file +}).catch(() => process.exit(1)); diff --git a/packages/salesforcedx-vscode-core/esbuild.config.js b/packages/salesforcedx-vscode-core/esbuild.config.js index c393ead221..9eaa0bcbc9 100644 --- a/packages/salesforcedx-vscode-core/esbuild.config.js +++ b/packages/salesforcedx-vscode-core/esbuild.config.js @@ -22,7 +22,13 @@ const sharedConfig = { keepNames: true, plugins: [ esbuildPluginPino({ transports: ['pino-pretty'] }) - ] + ], + supported: { + 'dynamic-import': false + }, + logOverride: { + 'unsupported-dynamic-import': 'error' + } }; const copyFiles = (src, dest) => { diff --git a/packages/salesforcedx-vscode-lightning/esbuild.config.js b/packages/salesforcedx-vscode-lightning/esbuild.config.js index 16c511faa0..e48bea14d4 100644 --- a/packages/salesforcedx-vscode-lightning/esbuild.config.js +++ b/packages/salesforcedx-vscode-lightning/esbuild.config.js @@ -23,7 +23,13 @@ const sharedConfig = { keepNames: true, plugins: [ esbuildPluginPino({ transports: ['pino-pretty'] }) - ] + ], + supported: { + 'dynamic-import': false + }, + logOverride: { + 'unsupported-dynamic-import': 'error' + } }; // copy core-bundle/lib/transformStream.js to dist if core-bundle is included @@ -48,4 +54,4 @@ const destPath = './dist/transformStream.js'; }); })().then(async () => { await copyFiles(srcPath, destPath); -}).catch(() => process.exit(1)); \ No newline at end of file +}).catch(() => process.exit(1)); diff --git a/packages/salesforcedx-vscode-lwc/esbuild.config.js b/packages/salesforcedx-vscode-lwc/esbuild.config.js index 54ff16aadd..476b3f3e3d 100644 --- a/packages/salesforcedx-vscode-lwc/esbuild.config.js +++ b/packages/salesforcedx-vscode-lwc/esbuild.config.js @@ -26,7 +26,13 @@ const sharedConfig = { keepNames: true, plugins: [ esbuildPluginPino({ transports: ['pino-pretty'] }) - ] + ], + supported: { + 'dynamic-import': false + }, + logOverride: { + 'unsupported-dynamic-import': 'error' + } }; // copy core-bundle/lib/transformStream.js to dist if core-bundle is included diff --git a/packages/salesforcedx-vscode-soql/esbuild.config.js b/packages/salesforcedx-vscode-soql/esbuild.config.js index b4ffe2b3fa..1497cd4f76 100644 --- a/packages/salesforcedx-vscode-soql/esbuild.config.js +++ b/packages/salesforcedx-vscode-soql/esbuild.config.js @@ -26,7 +26,13 @@ const sharedConfig = { keepNames: true, plugins: [ esbuildPluginPino({ transports: ['pino-pretty'] }) - ] + ], + supported: { + 'dynamic-import': false + }, + logOverride: { + 'unsupported-dynamic-import': 'error' + } }; // copy core-bundle/lib/transformStream.js to dist if core-bundle is included @@ -51,4 +57,4 @@ const destPath = './dist/transformStream.js'; }); })().then(async () => { await copyFiles(srcPath, destPath); -}).catch(() => process.exit(1)); \ No newline at end of file +}).catch(() => process.exit(1));