This repository was archived by the owner on Aug 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Hot Reload #185
Labels
enhancement
New feature or request
Comments
So // tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
} Because it has // launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}, But //tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": ["es6", "dom"],
"sourceMap": true,
"rootDir": "src",
"strict": true
},
"exclude": ["node_modules", ".vscode-test", "webview-ui"]
} For me the solution is to |
As mentioned here it's best (if possible) to work directly with the import type { UserConfig } from "vite";
import * as path from "node:path";
import { parseMods } from "../src/mod";
export default function customPlugin() {
return {
name: 'vite-plugin-custom',
config(config: UserConfig, { command }: { command: 'build' | 'serve' }) {
if (command === 'serve') {
let modDir = path.join(__dirname, "../example/mod")
let mods = parseMods(modDir)
config.define = {
...config.define,
__DEV_MODS__: mods,
};
}
}
};
} import customPlugin from './vite-plugin.custom'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), customPlugin()], data() {
return {
mods: __DEV_MODS__,
};
}, |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Extension/feature description
After running example following the given
README.md
:When I press F5 there is no hot reload; yes there is a new task
npm run watch
but it doesn't care about changes towebview-ui
so extension is not reloaded.Even when the extension is reloaded the
webview
invscode
won't reflect any changes without opening theHello World
command; it would be cool to auto-reload this also.Use case
Pleasantly developing extensions.
The text was updated successfully, but these errors were encountered: