Reputation: 103
I want to render html file with css, fonts and js inside (not linked but content inside). Css and fonts I have, but I can't find solution for js. I work on Node.js.
Upvotes: 1
Views: 1222
Reputation: 19581
You can use a plugin like html-webpack-inline-source-plugin.
Add to the plugins
object in your webpack.config.js
file
plugins: [
new HtmlWebpackPlugin({
inlineSource: '.(js|css)$' // embed all javascript and css inline
}),
new HtmlWebpackInlineSourcePlugin()
]
NB : This plugin only works together with html-webpack-plugin
Upvotes: 2
Reputation: 1435
you can use code block.
<code>js code here</code>
It is non executable code.
Upvotes: 0