Skip to content

CSS files are deleted when using together with CopyWebpackPlugin #39

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

Closed
creage opened this issue May 6, 2021 · 8 comments
Closed

CSS files are deleted when using together with CopyWebpackPlugin #39

creage opened this issue May 6, 2021 · 8 comments
Labels

Comments

@creage
Copy link

creage commented May 6, 2021

In my webpack config I have my main entry with HTML+CSS, and I want this CSS to be injected. I use simple

new HtmlInlineCSSWebpackPlugin()

for doing this, and it works fine.

I also have a CopyWebpackPlugin, which copies some third party lib, which includes HTML+CSS files in its assets.

These CSS files are removed when being copied. They are not removed if I use leaveCSSFile: true, but then the CSS file from main entry is not removed either.

I wonder why does this plugin deal with files from other plugin? But even if it does - I would expect these CSS get injected correctly in all HTML+CSS pairs it deals with. Currently it only REMOVES all of CSS files, without injecting them.

@runjuu
Copy link
Owner

runjuu commented May 10, 2021

Hi @creage, Sorry for the delayed response. Can you provide a minimal demo to reproduce the issue?

@creage
Copy link
Author

creage commented May 10, 2021

@runjuu here you go html-inline-css-webpack-plugin-broken

npm i
npm run build

Then check contents of dest/vendor folder. It should have both index.html and index.css, but has .html file only.

@creage
Copy link
Author

creage commented May 11, 2021

BTW, filtering on assets also works 😃

new HtmlInlineCSSWebpackPlugin({
	filter(name) {
		// don't mess the vendor styles!
		return !name.includes('vendor');
	}
})

@github-actions
Copy link

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Jul 11, 2021
@creage
Copy link
Author

creage commented Jul 11, 2021

Any progress on this issue?

@runjuu
Copy link
Owner

runjuu commented Jul 19, 2021

@creage There’s been no progress so far 😢

@runjuu runjuu reopened this Jul 19, 2021
@runjuu runjuu removed the Stale label Jul 19, 2021
@github-actions
Copy link

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Sep 18, 2021
@runjuu runjuu removed the Stale label Sep 18, 2021
@github-actions
Copy link

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

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

No branches or pull requests

2 participants