From 0fdefabab3a923d64b341bb1b287d09ca7ceb03e Mon Sep 17 00:00:00 2001 From: Lim Jet <57783762+daoauth@users.noreply.github.com> Date: Sun, 29 Dec 2024 16:24:00 +0900 Subject: [PATCH] update panel --- src/webview/panel/.gitignore | 41 +- src/webview/panel/README.md | 96 +- src/webview/panel/eslint.config.js | 28 + src/webview/panel/index.html | 13 + src/webview/panel/package-lock.json | 20033 ++-------------- src/webview/panel/package.json | 61 +- src/webview/panel/public/favicon.ico | Bin 16958 -> 0 bytes src/webview/panel/public/index.html | 43 - src/webview/panel/public/logo192.png | Bin 3769 -> 0 bytes src/webview/panel/public/logo512.png | Bin 8508 -> 0 bytes src/webview/panel/public/manifest.json | 25 - src/webview/panel/public/robots.txt | 3 - .../panel/scripts/build-react-no-split.js | 47 - src/webview/panel/src/App.test.tsx | 9 - src/webview/panel/src/components/Skeleton.tsx | 2 - src/webview/panel/src/index.tsx | 18 - src/webview/panel/src/main.tsx | 9 + src/webview/panel/src/react-app-env.d.ts | 1 - src/webview/panel/src/reportWebVitals.ts | 15 - src/webview/panel/src/setupTests.ts | 5 - src/webview/panel/src/vite-env.d.ts | 1 + src/webview/panel/tsconfig.app.json | 26 + src/webview/panel/tsconfig.json | 23 +- src/webview/panel/tsconfig.node.json | 24 + src/webview/panel/vite.config.ts | 16 + src/webview/panelProvider.ts | 11 +- 26 files changed, 2260 insertions(+), 18290 deletions(-) create mode 100644 src/webview/panel/eslint.config.js create mode 100644 src/webview/panel/index.html delete mode 100644 src/webview/panel/public/favicon.ico delete mode 100644 src/webview/panel/public/index.html delete mode 100644 src/webview/panel/public/logo192.png delete mode 100644 src/webview/panel/public/logo512.png delete mode 100644 src/webview/panel/public/manifest.json delete mode 100644 src/webview/panel/public/robots.txt delete mode 100644 src/webview/panel/scripts/build-react-no-split.js delete mode 100644 src/webview/panel/src/App.test.tsx delete mode 100644 src/webview/panel/src/index.tsx create mode 100644 src/webview/panel/src/main.tsx delete mode 100644 src/webview/panel/src/react-app-env.d.ts delete mode 100644 src/webview/panel/src/reportWebVitals.ts delete mode 100644 src/webview/panel/src/setupTests.ts create mode 100644 src/webview/panel/src/vite-env.d.ts create mode 100644 src/webview/panel/tsconfig.app.json create mode 100644 src/webview/panel/tsconfig.node.json create mode 100644 src/webview/panel/vite.config.ts diff --git a/src/webview/panel/.gitignore b/src/webview/panel/.gitignore index 4d29575..a547bf3 100644 --- a/src/webview/panel/.gitignore +++ b/src/webview/panel/.gitignore @@ -1,23 +1,24 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - +# Logs +logs +*.log npm-debug.log* yarn-debug.log* yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/src/webview/panel/README.md b/src/webview/panel/README.md index b87cb00..1e5a46b 100644 --- a/src/webview/panel/README.md +++ b/src/webview/panel/README.md @@ -1,46 +1,50 @@ -# Getting Started with Create React App - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.\ -You will also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: + +- Configure the top-level `parserOptions` property like this: + +```js +export default tseslint.config({ + languageOptions: { + // other options... + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + }, +}); +``` + +- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` +- Optionally add `...tseslint.configs.stylisticTypeChecked` +- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: + +```js +// eslint.config.js +import react from 'eslint-plugin-react'; + +export default tseslint.config({ + // Set the react version + settings: { react: { version: '18.3' } }, + plugins: { + // Add the react plugin + react, + }, + rules: { + // other rules... + // Enable its recommended rules + ...react.configs.recommended.rules, + ...react.configs['jsx-runtime'].rules, + }, +}); +``` diff --git a/src/webview/panel/eslint.config.js b/src/webview/panel/eslint.config.js new file mode 100644 index 0000000..2b3e6cc --- /dev/null +++ b/src/webview/panel/eslint.config.js @@ -0,0 +1,28 @@ +import js from '@eslint/js'; +import globals from 'globals'; +import reactHooks from 'eslint-plugin-react-hooks'; +import reactRefresh from 'eslint-plugin-react-refresh'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + { ignores: ['dist'] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ['**/*.{ts,tsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, + }, +); diff --git a/src/webview/panel/index.html b/src/webview/panel/index.html new file mode 100644 index 0000000..70ce4d5 --- /dev/null +++ b/src/webview/panel/index.html @@ -0,0 +1,13 @@ + + +
+ + + +He)Wi%l{(O z%YryK3E>H-{isMSoVuIhH2lkcQ|*>{{;BIinm;M?-Wn-ywt7a>1$;(bz}tisawRmp{K}zzBrI (wUM9sx l#<< zyxmhGGh; p3oL3ls)f4JT`m+YNY;MyH+%Lv DLtgKF9%WhQPX>(yv($X CL0cS!{7W$ulmU+9QfP#fERN!>s@V#A_EuEay^xjOn@Df|l{>?!aTzYY7%`=FI` zTk!6P&k@jT`*BoFT(->07jvF4b&6!CrfT-0@~co5`nnenal~6at8o6=*r#Wm7U_0a z=Z!h%+y_GjHb53`Kqi=ymM3UyzYqDtN6M6c+s?0scN_ 5%Cbnj|=e-Rb{#G=RBN(zb_T* zI1(<8PT)$; L=|IADY@7zf~MO*t09>KaUl-8JY^6w6}YaGH5XJFr$O|J4+_1ec(m2N1C zhm<^LtKaFl+x)4M(qWtyKu1%D&p RSDzj@%lNNb~J4U z+7c69?NOR9-fjM>UFLTXkJ
>GO7?BrCWQrd%Ds4DC!fp8pViX;774zJJ9EZD z4)56Eq*eF*zp6sU;upR%7V)?yIKw=u`9c>*j+ayE>8gmSye$0bOIkJS0~yu^@ekb> zPn|djep%kNxI!nf<5cGP=bmJZe>Ku<6OK98;7G)2*CJkf1#w$5$sPXm9nptGUy{Fv z_5KifGbYH`Am_cHbXhDje{y5|J!Q)li3#wxi+_5^#9pt;u61h- &+D zkoCL-&PwLB_$Ok5j18JdX7~r99#fi}I&m}n{o!3Ym$<*f`1fqw<4D`P*J=FQ6o2>( zeoafmdK>3B{yk^5tMTuN;ARy6;T`l406V%v(+!VHrt>FHBK|X7LhbH9@IKEnoNdmY zz(L3^8S&4(P~ ^`nD%)5*Gy=s--q;bGM0H^$U7e>8D?g{W PARC?C7~PdLj?_U$8kH*M6`MAGu*w(}qF$S~RajJd|Sw<~-9 zhWYzXIEBgvpet}6;FM=+FZeqh4 dB%+yt?g6X zyC~a~nS?1*Y%v2r538)Zao*#JgOSjIKy^Ute`y@eyi@fce+UQzaLP587$=L5nuL22 z)_4fHaXe_JXnQxtfS;8O$2HEl`bQ&%O9q0vF5G`)R0y79sR@(|Z~L)P^&&^aS+k{h zAKNf79&%*&Zkaha#1;?H{GPO3bWjd7e-GjUKPM)-a{m=4O^FAd2Do1ByItYA z&>rBu{2PE_;{E6CtG|))JrEB8Z?(Re(+Bw7Vwe1VT!&kLR{*Zha_3oEg=|j;@4x#3 zI{{P2pd7?QR(~{ChPQ94-Fc Gp8F+PNfWd7y}sEtj_vT)z8s) zwJsjV=SbirV3aPQz+3<~n_RP5tD3K~_Q8YWz`eNzun2H;bLS?WuK~OPt{-RB{cfL= z6L3H9GLQ&RH*n9~0|Wwp23Y2I%h9OgiXU?B-QmDAzyqif-e|YL3xAMucwj)S2fSty#E(0Si_S5 diff --git a/src/webview/panel/public/index.html b/src/webview/panel/public/index.html deleted file mode 100644 index 15ec726..0000000 --- a/src/webview/panel/public/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - VSCODE Extension (panel) - - - - - - - diff --git a/src/webview/panel/public/logo192.png b/src/webview/panel/public/logo192.png deleted file mode 100644 index c1741e7b203af72f32306cbd3d0affb0ddfd5070..0000000000000000000000000000000000000000 GIT binary patch literal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%+8!;z(aMJUL+#E)R j^3}d>oRsy^a z5$vS9mnIfeNo%U!iW~>d|LZ5pScIaERNQ*J7o3_XQZFc t}WI42ZCd*nUOt5?BJ^g3*1UQid>@z&K54e{3IcG;vgv? zNVeA!LA3HpJ(p|M5`bwVzJR-?uebKS(Fb(rt_hvKYY{E^d+*PxT|b%a3)c>oQ(KCC zPri=p%|t}$C!sxyw2RdEh~{2XxRsk6lH{TTpn@@BDo^-g+Z`n#iRas}DJ$0i6i#_U zQsQjC3u!h-U_P29D0^2*2JU!e%1I=jtUh&T-DdZP`Iij{t?yzU_a=8E+^gI)bmD9C z<*D71IaR|^Ti4 U%B}QRfhAP$ze&B*)J724e{1=@Qc7b0UpxCgSTAGB+gUWTt@2!xxmPz? z{Kg%@@1_OioMdrAg4p%W&C?`72(Nq|$)AM2Cp))rkf8DG5x2gzX{bESs*nEj31c8z zzzer>{Ii%yMtkFM27xR>-Je0YZqtcN`DDlxu766W-jOG8n`&B2DXNm5>0%<)dj3nl zsa%1gZWSzt-7@}J>vzvzp4SmSZo%9$KyN*)LrAMY7X?RQ<~ywmuLgjNn^qfC zTB*?dGBon;CXTtD{$Zp6-R+1JZm*7&CyCg`4_P%U47~tJ=qp2d$IJ?X?~rS%|F!Jz z)hzjG;KW2GM^p)H^@AEjL1cC!_mr2(>ddl5vqE_ c Fsh=p#omWq$0e zNtABd5z@u9N4WfGES 7LAU=s zl;>+;gQZ6Ca9gjBF765Ns(pH$iuLfS23J_f!=~(c_Nfq8d3I6kI?2--J;bCwx+Nw8 z`?PXD$7-T)O5=*6-9K&rdu*Yc2y?&8Qkr*bLOZ%fUa@M +p>P_>&Z_)3%!6#Kwx2Niz_?fee3@KTLu1# diff --git a/src/webview/panel/public/manifest.json b/src/webview/panel/public/manifest.json deleted file mode 100644 index 5470d93..0000000 --- a/src/webview/panel/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "VSCODE Extension (panel)", - "name": "VSCODE Extension (panel)", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/src/webview/panel/public/robots.txt b/src/webview/panel/public/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/src/webview/panel/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/src/webview/panel/scripts/build-react-no-split.js b/src/webview/panel/scripts/build-react-no-split.js deleted file mode 100644 index 439a26a..0000000 --- a/src/webview/panel/scripts/build-react-no-split.js +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env node - -/** - * A script that overrides some of the create-react-app build script configurations - * in order to disable code splitting/chunking and rename the output build files so - * they have no hash. (Reference: https://mtm.dev/disable-code-splitting-create-react-app). - * - * This is crucial for getting React webview code to run because VS Code expects a - * single (consistently named) JavaScript and CSS file when configuring webviews. - */ - -const rewire = require('rewire'); -const webpack = require('webpack'); -const defaults = rewire('react-scripts/scripts/build.js'); -const config = defaults.__get__('config'); - -// Disable code splitting -config.optimization.splitChunks = { - cacheGroups: { - default: false, - }, -}; - -// Disable code chunks -config.optimization.runtimeChunk = false; - -// Rename main.{hash}.js to main.js -config.output.filename = 'static/js/[name].js'; - -// Rename main.{hash}.css to main.css -config.plugins[5].options.filename = 'static/css/[name].css'; -config.plugins[5].options.moduleFilename = () => 'static/css/main.css'; - -config.resolve = { - ...config.resolve, - fallback: { - ...config.resolve.fallback, - buffer: require.resolve('buffer/'), - }, -}; - -config.plugins = [ - ...config.plugins, - new webpack.ProvidePlugin({ - Buffer: ['buffer', 'Buffer'], - }), -]; diff --git a/src/webview/panel/src/App.test.tsx b/src/webview/panel/src/App.test.tsx deleted file mode 100644 index 2a68616..0000000 --- a/src/webview/panel/src/App.test.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render( ); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/src/webview/panel/src/components/Skeleton.tsx b/src/webview/panel/src/components/Skeleton.tsx index 56dacef..f8f4aa6 100644 --- a/src/webview/panel/src/components/Skeleton.tsx +++ b/src/webview/panel/src/components/Skeleton.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - export const Skeleton = () => { const lineCount = Math.floor(Math.random() * (2 - 1 + 1)) + 1; return ( diff --git a/src/webview/panel/src/index.tsx b/src/webview/panel/src/index.tsx deleted file mode 100644 index cf1c08f..0000000 --- a/src/webview/panel/src/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; - -const root = ReactDOM.createRoot( - document.getElementById('root') as HTMLElement, -); -root.render( - - , -); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/src/webview/panel/src/main.tsx b/src/webview/panel/src/main.tsx new file mode 100644 index 0000000..e17d50b --- /dev/null +++ b/src/webview/panel/src/main.tsx @@ -0,0 +1,9 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; +import App from './App.tsx'; + +createRoot(document.getElementById('root')!).render( +- + , +); diff --git a/src/webview/panel/src/react-app-env.d.ts b/src/webview/panel/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5..0000000 --- a/src/webview/panel/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -///+ diff --git a/src/webview/panel/src/reportWebVitals.ts b/src/webview/panel/src/reportWebVitals.ts deleted file mode 100644 index 49a2a16..0000000 --- a/src/webview/panel/src/reportWebVitals.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ReportHandler } from 'web-vitals'; - -const reportWebVitals = (onPerfEntry?: ReportHandler) => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/src/webview/panel/src/setupTests.ts b/src/webview/panel/src/setupTests.ts deleted file mode 100644 index 8f2609b..0000000 --- a/src/webview/panel/src/setupTests.ts +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom'; diff --git a/src/webview/panel/src/vite-env.d.ts b/src/webview/panel/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/webview/panel/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/webview/panel/tsconfig.app.json b/src/webview/panel/tsconfig.app.json new file mode 100644 index 0000000..358ca9b --- /dev/null +++ b/src/webview/panel/tsconfig.app.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} diff --git a/src/webview/panel/tsconfig.json b/src/webview/panel/tsconfig.json index 9d379a3..1ffef60 100644 --- a/src/webview/panel/tsconfig.json +++ b/src/webview/panel/tsconfig.json @@ -1,20 +1,7 @@ { - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx" - }, - "include": ["src"] + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] } diff --git a/src/webview/panel/tsconfig.node.json b/src/webview/panel/tsconfig.node.json new file mode 100644 index 0000000..db0becc --- /dev/null +++ b/src/webview/panel/tsconfig.node.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2022", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/src/webview/panel/vite.config.ts b/src/webview/panel/vite.config.ts new file mode 100644 index 0000000..9cb20c3 --- /dev/null +++ b/src/webview/panel/vite.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react-swc'; + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [react()], + build: { + rollupOptions: { + output: { + entryFileNames: 'main.js', + chunkFileNames: 'chunks/[name].js', + assetFileNames: 'assets/[name].[ext]', + }, + }, + }, +}); diff --git a/src/webview/panelProvider.ts b/src/webview/panelProvider.ts index c400f3b..2a34825 100644 --- a/src/webview/panelProvider.ts +++ b/src/webview/panelProvider.ts @@ -122,18 +122,15 @@ class PanelProvider implements vscode.WebviewViewProvider { 'src', 'webview', 'panel', - 'build', - 'static', - 'css', - 'main.css', + 'dist', + 'assets', + 'index.css', ]); const scriptUri = getUri(webview, extensionUri, [ 'src', 'webview', 'panel', - 'build', - 'static', - 'js', + 'dist', 'main.js', ]); const nonce = getNonce();