Closed
Description
Hi Jan, I am considering to help add inline features to the plugin. What do you think?
In our business, we usually sth like <script src="xxx.js?__inline"></script> to make js or other static files inline in html files. This will greatly help us optimize the speed in certain circumstance.
Best regards,
Lee
Activity
lcxfs1991 commentedon Jan 6, 2016
This feature will encourage more person to use webpack instead of gulp.
For me, I am using gulp for resources inline and image sprites.
lcxfs1991 commentedon Jan 6, 2016
I study the source code, and find that it maybe difficult to add code to make files inline. But I think it is ok to add attributes or queries for next plugin to complete the resource inline jobs. For example, I can pass options like this:
var htmlPlugin = new HtmlWebpackPlugin({
filename: item + ".html",
excludeChunks: ['test'],
template: "src/" + item + ".html",
chunks: ['preview/preview', 'report/report'],
inject: true,
jsAttr: 'inline',
cssAttr: 'inline'
});
Then the result gives me:
or <script src="xxx.js?__inline"></script> or <script src="xxx.js" inline></script>I don't think this features will server for resource inline. It can server for other attributes like asyc, defer and so on.
If you think this is good, I can add this feature for the plugin and develop another plugin exclusively for resource inline.
Best regards,
Lee
jantimon commentedon Jan 7, 2016
I could add an event so you might inline everything during this event in another plugin - would that be a proper solution?
jantimon commentedon Jan 7, 2016
Added events which should allow you inlining the files:
https://github.com/ampedandwired/html-webpack-plugin/tree/feature/loaders#events
ghost commentedon Dec 19, 2016
link 404
lock commentedon May 31, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.