Skip to content

Specifying babelify options with node API #239

Open
@dbrgn

Description

@dbrgn

How can I pass babelify options using the node API?

With the command line API, I can do something like this:

-t [ babelify --presets [ env ] --extensions .ts ]

But with the Node API, this fails:

budo('src/app.ts:dist/app.js', {
    ...
    browserify: {
        transform: [babelify, {
            presets: ['@babel/preset-env'],
            extensions: '.ts',
        }],
    },
    ...

The error messages is TypeError: Path must be a string.. That error message comes from node_modules/resolve/lib/async.js.

What's the proper syntax for passing options to babelify? Maybe an example could be added to the README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions