bublejs / buble

https://buble.surge.sh
MIT License
870 stars 67 forks source link

.babelrc support? #145

Closed strarsis closed 6 years ago

strarsis commented 6 years ago

I want to add support for dynamic import syntax using this ,babelrc:

{
  "plugins": ["syntax-dynamic-import"]
}

However, it seems to be ignored.

buble is used with webpack (roots.io sage9 theme).

// ...
      {
        test: /\.js$/,
        exclude: [/node_modules(?![/|\\](bootstrap|foundation-sites))/],
        use: [
          { loader: 'cache' },
          { loader: 'buble', options: { objectAssign: 'Object.assign' } },
        ],
      },
// ...

This issue may be related: https://github.com/babel/babel-loader/issues/552

{ loader: 'buble', options: { objectAssign: 'Object.assign', babelrc: true } },

doesn't work either.

fskreuz commented 6 years ago

I'm not sure what you're trying to do. While Babel and Buble are both ESNext-to-ESNow transpilers, they are totally different implementations. Buble doesn't consume Babel configuration or plugins at all.

If you meant imlementing an rc file for Buble (i.e. have it scan for a .bublerc if no config is passed), that would totally be possible. However, it will still be incompatible with .babelrc for the said reason above.

strarsis commented 6 years ago

@fskreuz: Thanks. So for this particular project I would have to switch to Babel for supporting this feature (syntax-dynamic-import).