1.0.0 • Published 6 years ago
html-webpack-simple-inlinesource-plugin v1.0.0
html-webpack-simple-inlinesource-plugin
Enhances html-webpack-plugin functionality with inline js or css to html
Installation
Using npm:
$ npm i -g npm
$ npm i --save-dev html-webpack-simple-inlinesource-plugin
Basic Usage
Add the plugin to your webpack config as follows:
plugins: [ new HtmlWebpackPlugin(), new htmlWebpackSimpleInlinesourcePlugin() ]
the plugin must be created after HtmlWebpackPlugin.
in html
<link href="<%=htmlWebpackPlugin.files.css[css] %>" rel="stylesheet" data-source-inline="1"> <script src="../common/lib/zepto.min.js" data-source-inline="1" ></script> <script src="https://cdn.bootcss.com/jquery/3.3.1/core.js" data-source-inline="1" data-minify="1"></script>
Configuration
data-source-inline
: indicate the resource(etc: css or js) must be inlined to htmldata-minify
: only be used in script tag, indicating that the js file must be minified
1.0.0
6 years ago