Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Andy Wermke
    @andywer
    cool. so somewhere central. near alexanderplatz would be ideal for me, how about you, @zcei and @sapegin?
    Stephan Schneider
    @zcei
    I'm at Moritzplatz - so kinda in the same area as you are
    Stephan Schneider
    @zcei
    Any dietary restrictions anyone? At Kotti there's "Lasan", a place I really like (4 stations U8 for you @andywer)
    Jan van Brügge
    @jvanbruegge
    no restrictions for me
    when do we want to meet?
    Andy Wermke
    @andywer
    No restrictions either. Is @sapegin still on-board?
    How about 12:00 or 12:30? (I think @zcei needs to back at work at 13:30 or so, right?)
    Stephan Schneider
    @zcei
    Ah no that actually changed - so I'm now more flexible 👍
    Andy Wermke
    @andywer
    12:30 at Lasan?
    Jan van Brügge
    @jvanbruegge
    :+1:
    Stephan Schneider
    @zcei
    Sounds good!
    Jan van Brügge
    @jvanbruegge
    I am there, the guy with the luggage
    Andy Wermke
    @andywer
    😄
    Jan van Brügge
    @jvanbruegge
    pergamon museum was a good tip, really cool
    Andy Wermke
    @andywer
    Great!
    Vlad Zhukov
    @vlad-zhukov
    @andywer hey, did you solve your problems with the project setup?
    Andy Wermke
    @andywer
    hey @vlad-zhukov, thanks for asking! no, not yet.
    i am fairly certain it's some local issue on my machine, just don't know yet what it could be... but i am quite busy with other things right now, so i haven't had time to have another look at it yet
    Vlad Zhukov
    @vlad-zhukov
    Hi, I need to implement oneOf rule: https://webpack.js.org/configuration/module/#rule-oneof
    The API would look like this:
    oneOf('*.css', [
        match('*.css', {exclude: /\.modules\.css/}, [
            css(),
            postcss({plugins: []})
        ]),
        match('*.modules.css', [
            css.modules(),
            postcss({plugins: []})
        ]),
    ])
    Is it even possible?
    Stephan Schneider
    @zcei
    Looks good, would just say most-specific rules first, no?
    So in your example everything that matches *.modules.css also matches *.css first and bails already.
    Documenting this will be crucial - I feel like the the Webpack docs are not highlighting this enough
    Vlad Zhukov
    @vlad-zhukov
    It won't match because there is an exclude rule
    Stephan Schneider
    @zcei
    Doh, true
    We just need to see how the current API supports that. I think it should work, as all children would be expanded to rules inside of the array and the oneOf rule just attaches that to the property
    Vlad Zhukov
    @vlad-zhukov
    And also how is it going to work with the extract-text-plugin
    Stephan Schneider
    @zcei
    Do you have some context for me why the extract-text-plugin is different to the rest?
    Vlad Zhukov
    @vlad-zhukov
    The way blocks work right now is by directly mutating the config
    Vlad Zhukov
    @vlad-zhukov
    And it's polar opposite to returning an array and attaching it to a property
    Stephan Schneider
    @zcei
    Ohhh. So how I would approach it then to not change everything in the inner: let's see whether we can create a "fake config" we pass in. That one can be directly mutated, but lives in the inner of oneOf. Then afterwards the block can take the - now mutated - config and re-assign the properties where they belong
    Vlad Zhukov
    @vlad-zhukov
    Hm, good idea!
    Andy Wermke
    @andywer
    hey vlad! how about just doing this?
    group([
        match(['*.css', '!*.modules.css'], [
            css(),
            postcss({plugins: []})
        ]),
        match('*.modules.css', [
            css.modules(),
            postcss({plugins: []})
        ])
    ])
    Stephan Schneider
    @zcei
    @andywer that's some different semantics, no? In a oneOf you can have clauses that match to multiple rules. But on runtime webpack should determine the first that matches for a file and apply it. With group, all of the matching rules would be applied
    Andy Wermke
    @andywer

    It won't match because there is an exclude rule

    so my snippet is semantically equal, isn't it? in both snippets you provide two different matches, but only one is triggered at a time

    Stephan Schneider
    @zcei
    Yes for this very case that would work
    I don't know what use-case Webpack had in mind, but as it's specced we should provide a method for it I guess
    Andy Wermke
    @andywer
    ohh, my bad. i wasn't even aware it's a webpack feature... 😅
    Troy Blank
    @troyblank
    Hey everyone been trying to find a way online for a long time now to get this work so I figured maybe it wouldn't hurt asking everyone here. Basically I need to use extractText on some scss files that need modules and some that do not (incrementally converting stuff over to not use modules). The problem is this code only extracts the last match in this env wrapper. I have tried changing the file name to be something different for one of them but it still only exports the last one.
    env('production', [
        match(['*.not-modules.scss'], [
            sass({ sourceMap: true }),
            extractText('/styles/[name]-[chunkhash].css')
        ]),
        match(['*.scss', '!*.beta.scss'], [
            sass({ sourceMap: true }),
            css.modules(),
            extractText('/styles/[name]-[chunkhash].css')
        ])
    ])
    Troy Blank
    @troyblank
    I think i just have to make a custom block :( ....
    Andy Wermke
    @andywer
    Ohh, that might require a debugging session... What webpack-blocks & webpack version are you using, @troyblank?
    Creating a custom block isn't too hard, though, fortunately. That can always be plan B 😉
    Troy Blank
    @troyblank
    "webpack": "^4.20.2",
    "webpack-blocks": "^2.0.0-alpha"
    Andy Wermke
    @andywer
    hmm, everything up-to-date. i am at the chaos communication congress, so i can't look into it right now