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

214
Visualizações
Webpack - How can I inline script with webpack 5

I'm trying to use react for a Figma plugin project.

figma plugin ui only needs one html file like this.

// ui.html
<div id="react-page"></div>
<script type="text/javascript">
// here comes the inline script
</script>

I can't use <html>, <head> or <body> tag on this,

Because Figma plugin deletes the tags when loading the html file.

Among the contents of the file, the contents excluding the tags(<head>, ...) are inserted into the <body> of Figma plugin.

there's an option I can use:

html-webpack-inline-source-plugin

If I set this library as follows, it works as I want.

  plugins: [
    new HtmlWebpackPlugin({
      template: './src/app/index.html',
      filename: 'ui.html',
      inlineSource: '.(js)$',
      chunks: ['ui'],
    }),
    new HtmlWebpackInlineSourcePlugin(),
  ],

By the way, I want to use webpack 5 version. But, html-webpack-inline-source-plugin dosen't work at webpack5

Can I build an environment like this with webpack5?

about 4 years ago · Juan Pablo Isaza
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