Inline all the css and js assets in the html where the
<script>
,<link>
tags that contain theinline
attribute.
npm install --save html-webpack-inline-asset-plugin
Require the plugin in your webpack config:
var HtmlWebpackInlineAssetPlugin = require('html-webpack-inline-asset-plugin');
Add the plugin to your webpack config as follows:
plugins: [
new HtmlWebpackPlugin({inject: false}),
new HtmlWebpackInlineAssetPlugin()
]
Add the tag to your html template as follows:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" inline>
</head>
<body>
<script inline></script>
</body>
</html>
This project is licensed under MIT.