Skip to content

ReferenceError when using preact.config.js #343

@acoll

Description

@acoll

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
I added a preact.config.js because I wanted to add a webpack loader. I added an empty function that does nothing. Next I ran preact watch which results in this error:

ReferenceError: [BABEL] MY_LOCAL_PATH_TO_PROJECT/preact.config.js: Unknown option: base.plugin. Check out http://babeljs.io/docs/usage/options/ for more information about options.

A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

Invalid:
  `{ presets: [{option: value}] }`
Valid:
  `{ presets: [['presetName', {option: value}]] }`

For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.

I traced the bug back to here: https://github.com/developit/preact-cli/blob/master/src/lib/webpack/transform-config.js#L19.

I was able to workaround this by just creating an empty .babelrc in my project like this:

{}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions