Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
¿Cómo se importa un jQuery local a la vista web para las extensiones de VS Code?

¿Cómo se importa jquery en webview? Intenté modificar:

https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/

para utilizar la biblioteca jquery agregándola a la misma ubicación que main.js y luego agregando algo como esto:

 const jqueryPathOnDisk = vscode.Uri.joinPath(this._extensionUri, 'media', 'jquery-3.6.0.min.js'); const jqueryUri = (jqueryPathOnDisk).with({ 'scheme': 'vscode-resource' });

seguido por

 <script nonce="${nonce}" src="${jqueryUri}"></script>

Por aquí en el código:

https://github.com/microsoft/vscode-extension-samples/blob/116b0aa1ade25bfd3c6f3df0847200089b82b72f/webview-sample/src/extension.ts#L171

Pero desafortunadamente esto no parece funcionar.

También he intentado eliminar la siguiente línea:

 <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src ${webview.cspSource}; img-src ${webview.cspSource} https:; script-src 'nonce-${nonce}';">

de este archivo: https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/src/extension.ts

Y luego importar un cdn pero eso tampoco funciona. No importa qué window.jQuery devuelve indefinido.

Cualquier idea lo haría. ser apreciado.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!