Skip to content Skip to sidebar Skip to footer

Can't Get Browserify To Use Babel-plugin-transform-class-properties

I'm trying to use MobX in my project and I am attempting to use class properties. However, when I run through browserify (with Laravel's Elixir). I get the error Missing class prop

Solution 1:

You should override exactly babelify transformer:

elixir.config.js.browserify.transformers
  .find(transformer => transformer.name === 'babelify')
  .options = {
    presets: ['es2015', 'react', 'stage-1'],
    plugins: ['transform-class-properties'],
  };

or just use the same babel config file:

elixir.config.js.browserify.transformers
  .find(transformer => transformer.name === 'babelify')
  .options = require('./package.json').babel;

Post a Comment for "Can't Get Browserify To Use Babel-plugin-transform-class-properties"