jednano / craco-linaria

A craco plugin to use Linaria zero-runtime CSS in JS library in a create react app.
MIT License
28 stars 9 forks source link

fix: make pluginOptions work as documented #6

Closed Guria closed 5 years ago

jednano commented 5 years ago

I'm not understanding what this is fixing. Can you elaborate?

Guria commented 5 years ago

Current documentation states following way to define options:

module.exports = {
  plugins: [
    {
      plugin: CracoLinariaPlugin,
      options: {
        // Linaria options
      },
    },
  ],
}

But this doesn't works since current version tries to get config property of pluginOptions. Which is obviously undefined in this case.

jednano commented 5 years ago

OK sorry, but I'm really struggling to understand the root issue here. Are you suggesting that (undefined || undefined || {}).config || {} doesn't work in that it throws an error or something? What is the scenario in which this breaks? What is the expected result here and how does moving the ( help? I'm not seeing how.

Guria commented 5 years ago
({ someLinariaOption: true } || undefined || {}).config || {} // {}
{ someLinariaOption: true } || (undefined || {}).config || {} // { someLinariaOption: true }
jednano commented 5 years ago

:tada: This PR is included in version 1.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: