Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda