mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
tweak transpile and pasteUrl.test
This commit is contained in:
@@ -253,6 +253,7 @@ class ESBuildTranspiler {
|
||||
target: ['es2022'],
|
||||
format: this._cmdLine.options.module === ts.ModuleKind.CommonJS ? 'cjs' : 'esm',
|
||||
loader: 'ts',
|
||||
sourcemap: 'inline',
|
||||
tsconfigRaw: JSON.stringify({
|
||||
compilerOptions: this._cmdLine.options
|
||||
}),
|
||||
@@ -262,7 +263,7 @@ class ESBuildTranspiler {
|
||||
}).then(result => {
|
||||
// check if output of a DTS-files isn't just "empty" and iff so
|
||||
// skip this file
|
||||
if (file.path.endsWith('.d.ts') && _isDefaultEmpty(result.code)) {
|
||||
if (file.path.endsWith('.d.ts') || _isDefaultEmpty(result.code)) {
|
||||
return;
|
||||
}
|
||||
const outBase = this._cmdLine.options.outDir ?? file.base;
|
||||
@@ -282,6 +283,7 @@ exports.ESBuildTranspiler = ESBuildTranspiler;
|
||||
function _isDefaultEmpty(src) {
|
||||
return src
|
||||
.replace('"use strict";', '')
|
||||
.replace(/\/\/# sourceMappingURL.*^/, '')
|
||||
.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1')
|
||||
.trim().length === 0;
|
||||
}
|
||||
|
||||
@@ -324,6 +324,7 @@ export class ESBuildTranspiler implements ITranspiler {
|
||||
target: ['es2022'],
|
||||
format: this._cmdLine.options.module === ts.ModuleKind.CommonJS ? 'cjs' : 'esm',
|
||||
loader: 'ts',
|
||||
sourcemap: 'inline',
|
||||
tsconfigRaw: JSON.stringify({
|
||||
compilerOptions: this._cmdLine.options
|
||||
}),
|
||||
@@ -334,7 +335,7 @@ export class ESBuildTranspiler implements ITranspiler {
|
||||
|
||||
// check if output of a DTS-files isn't just "empty" and iff so
|
||||
// skip this file
|
||||
if (file.path.endsWith('.d.ts') && _isDefaultEmpty(result.code)) {
|
||||
if (file.path.endsWith('.d.ts') || _isDefaultEmpty(result.code)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -358,6 +359,7 @@ export class ESBuildTranspiler implements ITranspiler {
|
||||
function _isDefaultEmpty(src: string): boolean {
|
||||
return src
|
||||
.replace('"use strict";', '')
|
||||
.replace(/\/\/# sourceMappingURL.*^/, '')
|
||||
.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1')
|
||||
.trim().length === 0;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ suite('createEditAddingLinksForUriList', () => {
|
||||
});
|
||||
|
||||
test('Smart should be disabled in math blocks', async () => {
|
||||
const katex = (await import('@vscode/markdown-it-katex')).default;
|
||||
const katex = (<any>(await import('@vscode/markdown-it-katex')).default).default;
|
||||
const engine = createNewMarkdownEngine();
|
||||
(await engine.getEngine(undefined)).use(katex);
|
||||
assert.strictEqual(
|
||||
|
||||
Reference in New Issue
Block a user