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

209
Views
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
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!