Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Document babel 6 config #10

Closed
dtothefp opened this issue Dec 2, 2015 · 2 comments
Closed

Document babel 6 config #10

dtothefp opened this issue Dec 2, 2015 · 2 comments

Comments

@dtothefp
Copy link

dtothefp commented Dec 2, 2015

would be useful to document babel 6 configs that can be passed as options to isparta-loader. My project cannot use config straight from .babelrc because some of my plugins are not yet babel 6 compatible. I was able to use the new isparta-loader though with the following config. Hopefully this save others some debugging time. Also, would be useful to merge the options rather than having to redefine all of them

//webpack.config
export default {
  isparta: {
    embedSource: true,
    noAutoWrap: true,
    babel: {
      presets: ['es2015', 'stage-0', 'react']
    }
  },
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        loader: 'isparta',
        exclude: [
          /(test|node_modules)/,
          addbase(srcDir, scriptDir, 'index.js') //exclude react component mounting
        ]
      }
    ]
  }
}
@lmk123
Copy link

lmk123 commented Dec 4, 2015

OMG, you save a lot of time for me!

I use async/await functions ( stage-3 ) in Babel 6, and I try to follow README.md to generate code coverage, but I got many errors on async function some() { } expression in js file.

Your config options figure me out: I need to add babel 6 config in webpack.config.js so isparta can parse async/await functions.

Thank you very much!

@dtothefp
Copy link
Author

dtothefp commented Dec 4, 2015

:neckbeard: thanks for the update @deepsweet

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants