Skip to content

Commit 6786b0a

Browse files
committed
Revert e7fffbf
1 parent 001fb95 commit 6786b0a

File tree

5 files changed

+93
-149
lines changed

5 files changed

+93
-149
lines changed

extensions/markdown-language-features/esbuild-notebook.js

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
// @ts-check
65
const path = require('path');
76
const esbuild = require('esbuild');
8-
const watcher = require('@parcel/watcher');
97

108
const args = process.argv.slice(2);
119

@@ -17,29 +15,19 @@ if (outputRootIndex >= 0) {
1715
outputRoot = args[outputRootIndex + 1];
1816
}
1917

20-
const srcDir = path.join(__dirname, 'notebook');
2118
const outDir = path.join(outputRoot, 'notebook-out');
2219

23-
function build() {
24-
return esbuild.build({
25-
entryPoints: [
26-
path.join(__dirname, 'notebook', 'index.ts'),
27-
],
28-
bundle: true,
29-
minify: true,
30-
sourcemap: false,
31-
format: 'esm',
32-
outdir: outDir,
33-
platform: 'browser',
34-
target: ['es2020'],
35-
});
36-
}
37-
38-
39-
build().catch(() => process.exit(1));
40-
41-
if (isWatch) {
42-
watcher.subscribe(srcDir, () => {
43-
return build();
44-
});
45-
}
20+
esbuild.build({
21+
entryPoints: [
22+
path.join(__dirname, 'notebook', 'index.ts'),
23+
],
24+
bundle: true,
25+
minify: true,
26+
sourcemap: false,
27+
format: 'esm',
28+
outdir: outDir,
29+
platform: 'browser',
30+
target: ['es2020'],
31+
watch: isWatch,
32+
incremental: isWatch,
33+
}).catch(() => process.exit(1));

extensions/markdown-language-features/esbuild-preview.js

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
// @ts-check
65
const path = require('path');
76
const esbuild = require('esbuild');
8-
const watcher = require('@parcel/watcher');
97

108
const args = process.argv.slice(2);
119

@@ -17,29 +15,20 @@ if (outputRootIndex >= 0) {
1715
outputRoot = args[outputRootIndex + 1];
1816
}
1917

20-
const srcDir = path.join(__dirname, 'preview-src');
2118
const outDir = path.join(outputRoot, 'media');
2219

23-
function build() {
24-
return esbuild.build({
25-
entryPoints: [
26-
path.join(srcDir, 'index.ts'),
27-
path.join(srcDir, 'pre'),
28-
],
29-
bundle: true,
30-
minify: true,
31-
sourcemap: false,
32-
format: 'esm',
33-
outdir: outDir,
34-
platform: 'browser',
35-
target: ['es2020'],
36-
});
37-
}
38-
39-
build().catch(() => process.exit(1));
40-
41-
if (isWatch) {
42-
watcher.subscribe(srcDir, () => {
43-
return build();
44-
});
45-
}
20+
esbuild.build({
21+
entryPoints: [
22+
path.join(__dirname, 'preview-src', 'index.ts'),
23+
path.join(__dirname, 'preview-src', 'pre'),
24+
],
25+
bundle: true,
26+
minify: true,
27+
sourcemap: false,
28+
format: 'esm',
29+
outdir: outDir,
30+
platform: 'browser',
31+
target: ['es2020'],
32+
watch: isWatch,
33+
incremental: isWatch,
34+
}).catch(() => process.exit(1));

extensions/markdown-math/esbuild.js

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
const path = require('path');
88
const fse = require('fs-extra');
99
const esbuild = require('esbuild');
10-
const watcher = require('@parcel/watcher');
1110

1211
const args = process.argv.slice(2);
1312

@@ -19,44 +18,34 @@ if (outputRootIndex >= 0) {
1918
outputRoot = args[outputRootIndex + 1];
2019
}
2120

22-
const srcDir = path.join(__dirname, 'notebook');
2321
const outDir = path.join(outputRoot, 'notebook-out');
24-
25-
async function build() {
26-
await esbuild.build({
27-
entryPoints: [
28-
path.join(srcDir, 'katex.ts'),
29-
],
30-
bundle: true,
31-
minify: true,
32-
sourcemap: false,
33-
format: 'esm',
34-
outdir: outDir,
35-
platform: 'browser',
36-
target: ['es2020'],
37-
});
38-
39-
fse.copySync(
40-
path.join(__dirname, 'node_modules', 'katex', 'dist', 'katex.min.css'),
41-
path.join(outDir, 'katex.min.css'));
42-
43-
const fontsDir = path.join(__dirname, 'node_modules', 'katex', 'dist', 'fonts');
44-
const fontsOutDir = path.join(outDir, 'fonts/');
45-
46-
fse.mkdirSync(fontsOutDir, { recursive: true });
47-
48-
for (const file of fse.readdirSync(fontsDir)) {
49-
if (file.endsWith('.woff2')) {
50-
fse.copyFileSync(path.join(fontsDir, file), path.join(fontsOutDir, file));
51-
}
22+
esbuild.build({
23+
entryPoints: [
24+
path.join(__dirname, 'notebook', 'katex.ts'),
25+
],
26+
bundle: true,
27+
minify: true,
28+
sourcemap: false,
29+
format: 'esm',
30+
outdir: outDir,
31+
platform: 'browser',
32+
target: ['es2020'],
33+
watch: isWatch,
34+
incremental: isWatch,
35+
}).catch(() => process.exit(1));
36+
37+
fse.copySync(
38+
path.join(__dirname, 'node_modules', 'katex', 'dist', 'katex.min.css'),
39+
path.join(outDir, 'katex.min.css'));
40+
41+
42+
const fontsDir = path.join(__dirname, 'node_modules', 'katex', 'dist', 'fonts');
43+
const fontsOutDir = path.join(outDir, 'fonts/');
44+
45+
fse.mkdirSync(fontsOutDir, { recursive: true });
46+
47+
for (const file of fse.readdirSync(fontsDir)) {
48+
if (file.endsWith('.woff2')) {
49+
fse.copyFileSync(path.join(fontsDir, file), path.join(fontsOutDir, file));
5250
}
5351
}
54-
55-
56-
build().catch(() => process.exit(1));
57-
58-
if (isWatch) {
59-
watcher.subscribe(srcDir, () => {
60-
return build();
61-
});
62-
}

extensions/notebook-renderers/esbuild.js

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
// @ts-check
65
const path = require('path');
76
const esbuild = require('esbuild');
8-
const watcher = require('@parcel/watcher');
97

108
const args = process.argv.slice(2);
119

@@ -17,28 +15,19 @@ if (outputRootIndex >= 0) {
1715
outputRoot = args[outputRootIndex + 1];
1816
}
1917

20-
const srcDir = path.join(__dirname, 'src');
2118
const outDir = path.join(outputRoot, 'renderer-out');
2219

23-
function build() {
24-
return esbuild.build({
25-
entryPoints: [
26-
path.join(srcDir, 'index.ts'),
27-
],
28-
bundle: true,
29-
minify: false,
30-
sourcemap: false,
31-
format: 'esm',
32-
outdir: outDir,
33-
platform: 'browser',
34-
target: ['es2020'],
35-
});
36-
}
37-
38-
build().catch(() => process.exit(1));
39-
40-
if (isWatch) {
41-
watcher.subscribe(srcDir, () => {
42-
return build();
43-
});
44-
}
20+
esbuild.build({
21+
entryPoints: [
22+
path.join(__dirname, 'src', 'index.ts'),
23+
],
24+
bundle: true,
25+
minify: false,
26+
sourcemap: false,
27+
format: 'esm',
28+
outdir: outDir,
29+
platform: 'browser',
30+
target: ['es2020'],
31+
watch: isWatch,
32+
incremental: isWatch,
33+
}).catch(() => process.exit(1));

extensions/simple-browser/esbuild-preview.js

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
// @ts-check
65
const path = require('path');
76
const fs = require('fs');
87
const esbuild = require('esbuild');
9-
const watcher = require('@parcel/watcher');
108

119
const args = process.argv.slice(2);
1210

@@ -18,36 +16,27 @@ if (outputRootIndex >= 0) {
1816
outputRoot = args[outputRootIndex + 1];
1917
}
2018

21-
const srcDir = path.join(__dirname, 'preview-src');
2219
const outDir = path.join(outputRoot, 'media');
2320

24-
async function build() {
25-
fs.copyFileSync(
26-
path.join(__dirname, 'node_modules', 'vscode-codicons', 'dist', 'codicon.css'),
27-
path.join(outDir, 'codicon.css'));
28-
29-
fs.copyFileSync(
30-
path.join(__dirname, 'node_modules', 'vscode-codicons', 'dist', 'codicon.ttf'),
31-
path.join(outDir, 'codicon.ttf'));
32-
33-
await esbuild.build({
34-
entryPoints: [
35-
path.join(srcDir, 'index.ts')
36-
],
37-
bundle: true,
38-
minify: true,
39-
sourcemap: false,
40-
format: 'esm',
41-
outdir: outDir,
42-
platform: 'browser',
43-
target: ['es2020'],
44-
});
45-
}
46-
47-
build().catch(() => process.exit(1));
48-
49-
if (isWatch) {
50-
watcher.subscribe(srcDir, () => {
51-
return build();
52-
});
53-
}
21+
fs.copyFileSync(
22+
path.join(__dirname, 'node_modules', 'vscode-codicons', 'dist', 'codicon.css'),
23+
path.join(outDir, 'codicon.css'));
24+
25+
fs.copyFileSync(
26+
path.join(__dirname, 'node_modules', 'vscode-codicons', 'dist', 'codicon.ttf'),
27+
path.join(outDir, 'codicon.ttf'));
28+
29+
esbuild.build({
30+
entryPoints: [
31+
path.join(__dirname, 'preview-src', 'index.ts')
32+
],
33+
bundle: true,
34+
minify: true,
35+
sourcemap: false,
36+
format: 'esm',
37+
outdir: outDir,
38+
platform: 'browser',
39+
target: ['es2020'],
40+
watch: isWatch,
41+
incremental: isWatch,
42+
}).catch(() => process.exit(1));

0 commit comments

Comments
 (0)