Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Duplicate code in output #60

Closed
kibin opened this issue Mar 30, 2015 · 4 comments
Closed

Duplicate code in output #60

kibin opened this issue Mar 30, 2015 · 4 comments

Comments

@kibin
Copy link

kibin commented Mar 30, 2015

Say I have multiple components that require the same css file. When I use this plugin I get output file with multiple duplications of the contents of this file. Is there a way to prevent extracting files that were already extracted in the output file?

@0m15
Copy link

0m15 commented Apr 17, 2015

I'm experiencing this issue too.
Tried with DedupePlugin and UglifyJsPlugin, without success.

@0m15
Copy link

0m15 commented Apr 17, 2015

It seems that this is something that has to be handled by the specific loader.

See, for example:
webpack-contrib/sass-loader#31

I'm facing this problem with cssnext-loader.

@kibin
Copy link
Author

kibin commented Apr 27, 2015

@Zimok yeah, you’re right, the issue is happening before extract text plugin starts working

@kibin kibin closed this as completed Apr 27, 2015
@phun-ky
Copy link

phun-ky commented Jan 16, 2017

While the original issue here is related to sass/less/stylus, a fix/hack/patch for this is to use the optimize-css-assets-webpack-plugin in conjunction with extract-text-webpack-plugin to produce, like this: https://gist.github.com/phun-ky/766e5ec9f75eac61c945273a951f0c0b.

If you want to use this in dev, you will have to use a plugin like write-file-webpack-plugin to force webpack to write the file to disk in dev.

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

3 participants