Saturday, January 4, 2020

Use destructing at a method signature in TypeScript!

TypeScript destructing as shown off at this and this may take a more confusing shape like so:

module.exports = ({ file, options, env }) => ({
   plugins: {
      'postcss-cssnext': options.cssnext ? options.cssnext : false,
      'autoprefixer': env == 'production' ? options.autoprefixer : false
   }
});

 
 

What is above is a fatter version of the guts of the postcss.config.js file described here. The file variable is never used. :(

No comments:

Post a Comment