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

integrate (export chunk names for) html-webpack-plugin`? #62

Open
mwoz123 opened this issue Mar 6, 2021 · 1 comment
Open

integrate (export chunk names for) html-webpack-plugin`? #62

mwoz123 opened this issue Mar 6, 2021 · 1 comment

Comments

@mwoz123
Copy link

mwoz123 commented Mar 6, 2021

I'm trying to add (generated by webpack-merge-and-include-globally) legacy js ( es5-legacy-global-script.<hash>.js:) file to my index.html

My config

new MergeIntoSingleFilePlugin({
        files: {
            "es5-legacy-global-script.js": [
// dozens of legacy js files here
            ],
        },
        transformFileName: (fileNameBase, extension, hash) => isProd ? `${fileNameBase}.${hash}${extension}` : `${fileNameBase}${extension}`,

I tried to use https://github.com/jharris4/html-webpack-tags-plugin

new HtmlWebpackTagsPlugin({ scripts: [{ glob: 'es5-legacy-global-script*.js', globPath: 'dist',  path:''}] });

but it works only when previusly such file (es5-legacy-global-script.<hash>.js) exist in dist folder

More over developer of html-webpack-tags-plugin said that his plugin should be used for generating index.html tags for copied files, and asked why webpack-merge-and-include-globally doesn't integrate with html-webpack-plugin by adding its (webpack-merge-and-include-globally) chunks to html-webpack-plugin ? see jharris4/html-webpack-tags-plugin#69

Good question can webpack-merge-and-include-globally integrate with html-webpack-plugin ?
might be usefull https://github.com/jantimon/html-webpack-plugin#events

@mwoz123
Copy link
Author

mwoz123 commented Mar 8, 2021

There's a workaround using HtmlWebpackTagsPlugin: #16 (comment)

but it would be nice to have it integrated with html-webpack-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant