Skip to content

Commit 6d6e7b5

Browse files
Merge pull request #9 from solarspace-dev/share-code
Fix bundle
2 parents 63ff64c + 5d63200 commit 6d6e7b5

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

vscode-ext/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publisher": "solarspace",
44
"displayName": "Solar Space",
55
"description": "Sharable URLs for GitHub codespaces",
6-
"version": "0.0.8",
6+
"version": "0.0.9",
77
"license": "GPL-3.0-only",
88
"engines": {
99
"vscode": "^1.90.0"

vscode-ext/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ const mainJs = panel.webview.asWebviewUri(vscode.Uri.file(path.resolve(context.e
315315
const html = template
316316
.replace(/%CSP_SOURCE%/gu, panel.webview.cspSource)
317317
.replace('./style.css', mainCss.toString())
318-
.replace('./src/index.ts', mainJs.toString());
318+
.replace('./index.js', mainJs.toString());
319319
return html;
320320
}
321321

vscode-ext/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ const extensionConfig = {
4444
plugins: [
4545
new CopyPlugin({
4646
patterns: [
47-
{ from: path.resolve(__dirname, 'webview/dist'), to: path.resolve(__dirname, 'dist/webview') }
47+
{ from: path.resolve(__dirname, 'webview/dist'), to: path.resolve(__dirname, 'dist/webview') },
48+
{ from: path.resolve(__dirname, 'webview/index.html'), to: path.resolve(__dirname, 'dist/webview/index.html') },
4849
],
4950
}),
5051
],

vscode-ext/webview/index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
Copy Snapshot
5959
</button>
6060
</div>
61-
62-
63-
<script src="./src/index.ts"></script>
61+
<script src="./index.js"></script>
6462
</body>
6563
</html>

vscode-ext/webview/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import '../style.css'; // Imported so vite can process it
2+
13
import { $ } from './util.js';
24
import { takeSnap } from './snap.js';
35
import { createHighlighterCore } from 'shiki';

vscode-ext/webview/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ export default defineConfig({
1111
assetsInlineLimit: () => true,
1212
cssCodeSplit: false,
1313
rollupOptions: {
14-
input: './index.html',
14+
input: './src/index.ts',
1515
output: {
16+
format: 'iife', // ← use IIFE format for webview
1617
entryFileNames: 'index.js', // ← force output file name
1718
manualChunks: undefined, // ← disables code splitting
1819
assetFileNames: '[name][extname]',

0 commit comments

Comments
 (0)