amireh / happypack

Happiness in the form of faster webpack build times.
MIT License
4.23k stars 124 forks source link

Loaded babel plugins become null #237

Closed SBRK closed 6 years ago

SBRK commented 6 years ago

If I pass babel plugins as functions, as opposed to strings, when using them in HappyPack they become null and babel throws.

Here is a look at my babel plugins:

const babelLodashPlugin = require('babel-plugin-lodash')
const babelReactInlineElementsPlugin = require('babel-plugin-transform-react-inline-elements')
const babelReactConstantElementsPlugin = require('babel-plugin-transform-react-constant-elements')
const reactHotLoaderBabel = require('react-hot-loader/babel')

const babelPlugins = [
  'transform-class-properties',
  babelLodashPlugin,
  reactHotLoaderBabel,
  babelReactInlineElementsPlugin,
  babelReactConstantElementsPlugin,
]

And here is the error: (because all plugins after transform-class-properties are null)

ERROR in ./src/client/index.js
Module build failed: TypeError: Falsy value found in plugins
    at C:\dev\app\node_modules\babel-core\lib\transformation\file\options\option-manager.js:163:15
SBRK commented 6 years ago

Ok, I didn't read the doc :)