building on a mac works! so does editorInset!

This commit is contained in:
Andrew Pareles 2024-10-22 23:49:03 -07:00
parent f2b3a2be30
commit 4dd6553e34
5 changed files with 612 additions and 197 deletions

View file

@ -9,11 +9,11 @@ const to = 'dist/sidebar/styles.css'
const original_css_contents = fs.readFileSync(from, 'utf8')
postcss([
tailwindcss, // this compiles tailwind of all the files specified in tailwind.config.json
autoprefixer,
tailwindcss, // this compiles tailwind of all the files specified in tailwind.config.json
autoprefixer,
])
.process(original_css_contents, { from, to })
.then(processed_css_contents => { fs.writeFileSync(to, processed_css_contents.css) })
.catch(error => {
console.error('Error in build-css:', error)
})
.process(original_css_contents, { from, to })
.then(processed_css_contents => { fs.writeFileSync(to, processed_css_contents.css) })
.catch(error => {
console.error('Error in build-css:', error)
})

View file

@ -2,12 +2,12 @@ const esbuild = require('esbuild')
// Build JS
esbuild.build({
entryPoints: ['src/sidebar/index.tsx'],
bundle: true,
minify: true,
sourcemap: true,
outfile: 'dist/sidebar/index.js',
format: 'iife', // apparently iife is safe for browsers (safer than cjs)
platform: 'browser',
external: ['vscode'],
entryPoints: ['src/sidebar/index.tsx'],
bundle: true,
minify: true,
sourcemap: true,
outfile: 'dist/sidebar/index.js',
format: 'iife', // apparently iife is safe for browsers (safer than cjs)
platform: 'browser',
external: ['vscode'],
}).catch(() => process.exit(1));

File diff suppressed because it is too large Load diff

View file

@ -101,7 +101,8 @@
}
},
"scripts": {
"vscode:prepublish": "echo \"running prepublish\"",
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"build": "rimraf dist && node build-tsx.js && node build-css.js",
"pretest": "tsc -p ./ && eslint src --ext ts",

View file

@ -47,12 +47,12 @@ export function activate(context: vscode.ExtensionContext) {
if (!editor) return
const inset = vscode.window.createWebviewTextEditorInset(editor, 10, 200, {})
inset.webview.html = `
<html>
<body>Hello World!</body>
</html>
`;
// const inset = vscode.window.createWebviewTextEditorInset(editor, 10, 200, {})
// inset.webview.html = `
// <html>
// <body>Hello World!</body>
// </html>
// `;
// show the sidebar