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?