html-webpack-place-assets-plugin
Use with html-webpack-plugin。
Feature 1
Set option entry: 'entry.js'
to HtmlWebpackPlugin, HtmlWebpackPlugin will collect all chunks that are the entry's dependence, and inject them into html.
This feature is what the html-webpack-plugin will to do.
## Feature 2
Set option inject: false
to HtmlWebpackPlugin, then the css or js will inject to the placeholder what you set.
Dependences
html-webpack-place-assets-plugin@4.x:
html-webpack-place-assets-plugin@2.x:
Use and Settings
Add place holders to html:
Vue start test ${require('./partial/tongji.html')} <!-- html-webpack-plugin-css --> <!-- html-webpack-plugin-script -->
Set entry: 'entry.js'
and inject: false
to HtmlWebpackPlugin:
const htmlPlugins = ;// html filesObject;
Use this plugin:
plugins: // HtmlWebpackPlugin's head tag headReplaceExp: /<!-- html-webpack-plugin-css -->/ // HtmlWebpackPlugin's body tag bodyReplaceExp: /<!-- html-webpack-plugin-script -->/ // beauty tagsJoin: '\n '