Using Meteor 1.3, Mantra and Babel Stage 0 preset

I’m trying to use Meteor 1.3, Mantra, and babel stage 0 preset, but I’m having trouble getting it to work.

.babelrc

{
  "presets": ["es2015", "stage-2", "react"],
  "plugins": ["react-require", "babel-root-slash-import"]
}

package.json

{
  "name": "app",
  "version": "0.0.0",
  "scripts": {
    "lint": "eslint ./lib ./client ./server --ext .js --ext .jsx",
    "lintfix": "npm run lint -- --fix",
    "testonly": "mocha client/**/tests/**/*.js --compilers js:babel-core/register",
    "test": "npm run lint && npm run testonly",
    "test-watch": "npm run testonly -- --watch --watch-extensions js,jsx"
  },
  "devDependencies": {
    "babel-core": "6.x.x",
    "babel-plugin-react-require": "2.x.x",
    "babel-polyfill": "6.x.x",
    "babel-preset-es2015": "6.x.x",
    "babel-preset-react": "6.x.x",
    "babel-preset-stage-0": "6.x.x",
    "babel-root-slash-import": "1.x.x",
    "chai": "3.x.x",
    "enzyme": "1.x.x",
    "eslint": "1.10.x",
    "eslint-plugin-react": "3.15.x",
    "mocha": "2.x.x",
    "react-addons-test-utils": "^0.14.6",
    "sinon": "1.17.x"
  },
  "dependencies": {
    "domready": "^1.0.8",
    "react": "^0.14.6",
    "react-dom": "^0.14.6",
    "mantra-core": "^1.2.0",
    "react-mounter": "^1.0.0",
    "ramda": "0.18.0",
    "random-words": "0.0.1",
    "material-ui": "0.14.4 "
  },
  "private": true
}
1 Like

I just hit that wall too. It turns out that the support for configuring babel via .babelrc was turned off but @benjamn and the rest of the team are considering enabling it again.

Check out this Github issue for more details: https://github.com/meteor/meteor/issues/6351

It seems that for now we must stick to the ugly this.myMethod.bind(this) way for class methods.

1 Like