Inline all
<script>
,<link>
and<img>
tags that contain theinline
attribute with inline-source.
npm install --save-dev inline-source-webpack-plugin
Require the plugin in your webpack config:
var InlineSourceWebpackPlugin = require('inline-source-webpack-plugin');
Add the plugin to your webpack config as follows:
plugins: [
new HtmlWebpackPlugin(),
new InlineSourceWebpackPlugin()
/*
// option
new InlineSourceWebpackPlugin({
// the option with https://github.com/popeindustries/inline-source
})
*/
]
Add the tag to your html template as follows:
<!DOCTYPE html>
<html>
<head>
<script inline src="your_file.js"></script>
</head>
<body>
</body>
</html>