Skip to content

css-loader 0.15.1 breaks keyframe animations #89

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
mareksuscak opened this issue Jun 26, 2015 · 5 comments
Closed

css-loader 0.15.1 breaks keyframe animations #89

mareksuscak opened this issue Jun 26, 2015 · 5 comments

Comments

@mareksuscak
Copy link
Contributor

For me it either:

  1. Removes "unused" keyframe animations (when keyframe animation is defined in one file but is used in another file only - it just guesses that this keyframes are not used anywhere)
  2. If two animations are defined in one file, this file is then included in another two files, animations get the same single letter name a which breaks one of them with lower priority (because the latter overrides the former) - see more details here.
@ben-eb
Copy link
Contributor

ben-eb commented Jun 29, 2015

I wrote this behaviour, which is best when all of your CSS is defined in single file. Both of these transformations can be disabled; the first by cssnano.options.unused and the second by cssnano.options.idents.

markdalgleish added a commit that referenced this issue Jul 2, 2015
Disable unused rule removal & identifier reduction. Fixes #89.
@Kelderic
Copy link

Just in case anyone stumbles across this, it's discardUnused, not unused, in recent versions.

@Cevantime
Copy link

And, if i'm not mistaken, it's mergeIdents and not idents anymore !

@ben-eb
Copy link
Contributor

ben-eb commented Apr 26, 2017

Yeah, we deprecated these in v2.5.0 (and removed in v3.0.0)

@burtyish
Copy link

burtyish commented Oct 26, 2017

If two animations are defined in one file, this file is then included in another two files, animations get the same single letter name a which breaks one of them with lower priority (because the latter overrides the former) - see more details here.

I see this effect when I'm using css-loader for ExtractTextPlugin. I've tried to disable the options mentioned above. I've even tried to disable minimizing entirely, but the keyframe names are still renamed to a.

Here's my configuration:

    scss: {
        test: /\.scss$/,
        use: ExtractTextPlugin.extract({
                fallback: 'style-loader',
                use: [
                    'css-loader?sourceMap&minimize=false',
/* I've tried these too:
                    'css-loader?sourceMap&minimize.discardUnused=false&minimize.mergeIdents=false',
                    'css-loader?-minimize',
                    {
                        loader: 'css-loader',
                        options: {
                            minimize: {                            
                                discardUnused: false,
                                mergeIdents: false,
                            }
                       }
                    }
*/
                    'sass-loader'
                ]
            })
    }
  • webpack 2.7.0
  • css-loader: 0.28.7
  • extract-text-webpack-plugin: 2.1.0

I'm not sure if the problem lies in css-loader or in the way ExtractTextPlugin uses it.
I've been working on this problem for hours now.
Would love to hear if anyone has any helpful tips.

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

5 participants