Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inline feature to the plugin #157

Closed
lcxfs1991 opened this issue Jan 6, 2016 · 6 comments
Closed

Add inline feature to the plugin #157

lcxfs1991 opened this issue Jan 6, 2016 · 6 comments

Comments

@lcxfs1991
Copy link

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

@lcxfs1991
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

jantimon commented 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
Copy link
Owner

jantimon commented Jan 7, 2016

Added events which should allow you inlining the files:
https://github.com/ampedandwired/html-webpack-plugin/tree/feature/loaders#events

@ghost
Copy link

ghost commented Dec 19, 2016

link 404

@lock
Copy link

lock bot commented 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.

@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants