Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How have you found plug in support? The new features, etc look great, but I'm worried that there will lots of plugins that simply don't support the new version, or only have buggy bleeding edge versions that do....


Also, if you find a plugin or a loader who is struggling to support or catch up, just drop us a message on github or tweet me at @thelarkinn, and myself or one of the other maintainers will offer to help or take over the plugin. We have a whole contrib team dedicated to helping maintain our core org loaders and we are always wanting to keep the ecosystem strong and up to date.


Thank you for your hard work! You people are helping web developers tremendously.


There's `webpack.LoaderOptionsPlugin` which allows backwards compatibility, generally solves the problem.

One word of warning: LoaderOptionsPlugin _may_ mess with "context", so you should always redefine it in each plugin option object.

For example, using PostCSS without a .postcssrc:

    // postcss hasn't yet started to use options within rule definitons of
    // webpack 2; instead, we use a LoaderOptionsPlugin which provides
    // webpack 1 support of options to postcss.
    // https://github.com/postcss/postcss-loader/issues/92#issuecomment-251439696
    new webpack.LoaderOptionsPlugin({
      options: {
        // See https://github.com/postcss/postcss-loader/issues/99#issuecomment-248878925 and
        // https://github.com/webpack/webpack/issues/3018#issuecomment-248445176
        context: __dirname,
        postcss: [
          require('postcss-mixins'),
          require('postcss-simple-vars'),
          // TODO: Remove and use css variables (http://cssnext.io/features/#custom-properties-var)
          require('postcss-constants')({
            defaults: defaults
          }),
          require('postcss-each'),
          require('postcss-cssnext')({
            browsers: 'last 2 versions',
            features: {
              // https://github.com/robwierzbowski/node-pixrem/issues/40
              rem: false
            },
            import: true,
            compress: false,
            messages: true
          }),
          require('postcss-nested'),
          require('lost')
        ]
      }
    })
You can get around this by using a postcss plugin to read from the common config file (.postcssrc iirc) also, but I depend on requires for postcss-constants so couldn't.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: