-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow to only generate a json with assets list #982
Comments
You can already do that using a template and setting |
@jantimon Ah right, thanks a lot for telling https://github.com/jantimon/html-webpack-plugin/blob/webpack-4/index.js#L118 There's another apporach I've taken too, it's to use ManifestPlugin and add the assets ordering there: shellscape/webpack-manifest-plugin#93 (comment) |
Concerning what you said
I'm not sure I can do it fully, except if I can export the assetJson object my end goal is to have a template like (I named it module.exports = ({
htmlWebpackPlugin: {options = {}} = {},
jsAssets = [],
cssAssets = [],
injectedEnv = options.injectedEnv || '',
nonce = '',
..
}) => `<!DOCTYPE html><html> .... ` I don't use any index.html, in dev mode I can still use html-webpack-plugin, with inject: false or true actually. in production mode, I want more flexibility (the injectedEnv, and other dynamic things (like |
You can use the template parameters similar to this example: https://github.com/jantimon/html-webpack-plugin/tree/master/examples/template-parameters Instead of using an object you would have to pass a function |
@jantimon awesome work, sincere thanks for that I see that webpack4 is providing the ordered stuff now, great I still see some dups in the assets, eg: |
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. |
I'm wondering if I should add a
chunksSortFile
option, and allow to passfilename: null
so that the ouput of this plugin is a simple json containing js and css sorted listOr should it be another plugin, sharing the same sorting logic: https://github.com/caub/webpack-plugin-assets
The goal is to only have this assets list from the build, and handle the html templating independently
The text was updated successfully, but these errors were encountered: