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

Improve webpack config for HtmlBundlerPlugin #2072

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

webdiscus
Copy link

@webdiscus webdiscus commented Mar 3, 2025

Hello,

I'm the author of the html-bundler-webpack-plugin.
I want to improve the Webpack configuration to save processed JS and CSS in separate folders.

Defaults Webpack places generated HTML, JS and CSS files into directory specified in the output.path Webpack option.
After running npm run bundle, the src/fontra/client/ directory contains a mix of generated HTML, CSS, and JS files.

image

This PR allows configuring the Bundler Plugin to save JS and CSS, resolved in HTML, into separate directories:

  • CSS -> src/fontra/client/css/
  • JS -> src/fontra/client/js/

See js and css plugin options.

Hashed file names ensure that the output file name is unique, avoiding conflicts with copied files.
Now, the root web directory src/fontra/client/ contains only generated HTML files.

Pasted Graphic 2

All assets will be loaded in a browser:

Pasted Graphic 1

Copy link

google-cla bot commented Mar 3, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Successfully merging this pull request may close these issues.

1 participant