Skip to content

Commit

Permalink
Return to no bundling on plugin side
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-grant-work committed Nov 7, 2023
1 parent 66232f0 commit daa75d4
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 59 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
out
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/node_modules/
/out/
/dist/
*.vsix
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/node_modules/
/out/
/dist/
*.vsix
23 changes: 12 additions & 11 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Exclude everything
*
*/

# Include the following:
!images/
!dist/
!LICENSE
!NOTICE
!package.json
!README.md
adapter
.gitignore
.gitmodules
.vscode
dist/**/*.map
**/*.tsbuildinfo
package-lock.json
README.md
src
tsconfig.json
webpack.config.js
*.code-workspace
32 changes: 3 additions & 29 deletions esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,17 @@ const commonConfig = {
sourcemap: CLIDevelopment,
};

const outDir = path.join(__dirname, 'out');
const debugAdapterRoot = path.join(
__dirname,
'node_modules',
'cdt-gdb-adapter',
'dist'
);
const srcDir = path.join(__dirname, 'src');
/** @type {BuildOptions[]} */
const configurations = [
{
entryPoints: [path.join(outDir, 'extension.js')],
outdir: path.join(__dirname, 'dist'),
external: ['vscode'],
format: 'cjs',
platform: 'node',
...commonConfig,
},
{
entryPoints: [path.join(outDir, 'memory', 'client', 'index.js')],
outfile: path.join(__dirname, 'dist', 'MemoryBrowser.js'),
entryPoints: [path.join(srcDir, 'memory', 'client', 'index.tsx')],
outfile: path.join(__dirname, 'dist', 'MemoryBrowser-bundle.js'),
plugins: [sassPlugin()],
format: 'iife',
platform: 'browser',
...commonConfig,
},
{
entryPoints: [
path.join(debugAdapterRoot, 'debugAdapter.js'),
path.join(debugAdapterRoot, 'debugTargetAdapter.js'),
],
outdir: path.join(__dirname, 'dist'),
external: os.platform() !== 'linux' ? ['*/pty.node'] : undefined,
loader: { '.node': 'copy' },
format: 'cjs',
platform: 'node',
...commonConfig,
},
];

if (CLIWatch) {
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{
"type": "gdb",
"label": "GDB",
"program": "./dist/debugAdapter.js",
"program": "./node_modules/cdt-gdb-adapter/dist/debugAdapter.js",
"runtime": "node",
"configurationAttributes": {
"launch": {
Expand Down Expand Up @@ -228,7 +228,7 @@
{
"type": "gdbtarget",
"label": "GDB Target",
"program": "./dist/debugTargetAdapter.js",
"program": "./node_modules/cdt-gdb-adapter/dist/debugTargetAdapter.js",
"runtime": "node",
"configurationAttributes": {
"launch": {
Expand Down Expand Up @@ -726,10 +726,8 @@
"watch:tsc": "tsc -b -w",
"build:esbuild": "node esbuild.js",
"watch:esbuild": "node esbuild.js --watch",
"build": "run-s build:*",
"pre-watch": "yarn build",
"do-watch": "run-p watch:*",
"watch": "run-s pre-watch do-watch",
"build": "run-p build:*",
"watch": "run-p watch:*",
"lint": "eslint . --ext .ts,.tsx",
"format": "prettier --write .",
"format-check": "prettier --check .",
Expand Down
2 changes: 1 addition & 1 deletion src/memory/client/MemoryBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import * as React from 'react';
import { MemoryContents } from 'cdt-gdb-adapter';

import '../../../src/memory/client/MemoryBrowser.scss';
import './MemoryBrowser.scss';
import { messageBroker } from './MessageBroker';

class ForwardIterator implements Iterator<number> {
Expand Down
2 changes: 1 addition & 1 deletion src/memory/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "../../../out/memory",
"outDir": "../../../dist/memory",
"rootDir": "../",
"esModuleInterop": true
},
Expand Down
14 changes: 7 additions & 7 deletions src/memory/server/MemoryServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ export class MemoryServer {
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="${newPanel.webview.asWebviewUri(
vscode.Uri.joinPath(
context.extensionUri,
'dist/MemoryBrowser.css'
)
)}" type="text/css" rel="stylesheet"></link>
<link href="${newPanel.webview.asWebviewUri(
vscode.Uri.joinPath(
context.extensionUri,
'dist/MemoryBrowser-bundle.css'
)
)}" type="text/css" rel="stylesheet"></link>
</head>
<body>
<div id="app"></div>
<script src="${newPanel.webview
.asWebviewUri(
vscode.Uri.joinPath(
context.extensionUri,
'dist/MemoryBrowser.js'
'dist/MemoryBrowser-bundle.js'
)
)
.toString()}"></script>
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"module": "commonjs",
"moduleResolution": "node",
"target": "es2015",
"outDir": "out",
"outDir": "dist",
"lib": ["es2015", "dom"],
"jsx": "react",
"strict": true,
Expand Down

0 comments on commit daa75d4

Please sign in to comment.