Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

329
Visualizações
Angular 12 load external scripts as type module

Is it possible to set Angular to load external scripts defined in the angular.json under architect/build/options/scripts as type="module"?

When running Angular I can see the automatically injected script tags like this:

<script src="runtime.js" type="module"></script>
<script src="polyfills.js" type="module"></script>
<script src="styles.js" type="module"></script>
<script src="scripts.js" defer></script>
<script src="vendor.js" type="module"></script>
<script src="main.js" type="module"></script>

The scripts.js has a defer attribute, but not type="module". I'm trying to load a Stencil JS Web Component installed via npm into my app. The Stencil Component Script needs to be loaded as module, otherwise the other imports won't work.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I can also confirm it's not currently possible to add a type attribute to the scripts field. Possible values are: object with inject|lazy|bundleName|input attributes or directly a string.

To use a WebComponent in Angular, I ended up adding an import statement into the polyfills.ts file

import 'node_modules/my-web-components/dist/example.js';

I was able to see the content imported correctly and my web component was active in my angular component html file. content added here

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda