Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to babel 6 #51

Closed
rodneyrehm opened this issue Nov 13, 2015 · 2 comments
Closed

upgrade to babel 6 #51

rodneyrehm opened this issue Nov 13, 2015 · 2 comments
Labels

Comments

@rodneyrehm
Copy link
Member

a few things have changed and with babel 6 -
http://jamesknelson.com/the-six-things-you-need-to-know-about-babel-6/

@rodneyrehm
Copy link
Member Author

I'm not sure this is such a great idea at this point.

-    "babel": "^5.8.23",
+    "babel-cli": "^6.1.18",
+    "babel-plugin-transform-es2015-modules-amd": "^6.1.18",
+    "babel-plugin-transform-es2015-modules-commonjs": "^6.1.20",
+    "babel-preset-es2015": "^6.1.18",

@rodneyrehm
Copy link
Member Author

The main problem here was that I couldn't get transform-es2015-modules-amd to generate AMD files that would provide the default export, as is easily accomplised for CommonJS using babel-plugin-add-module-exports. However, transform-es2015-modules-umd works fine with add-module-exports. So it is possible to cheat AMD systems by providing them UMD files. It's not a perfect solution, but it works.

# generating the UMD bundle
browserify dist/src/ally.js \
  --debug \
  --standalone ally \
  --transform rollupify \
  --transform [ babelify --presets [ es2015 ] ] \
  | exorcist dist/ally.js.map > dist/ally.js

# generating the CommonJS module files
babel --presets es2015 \
  --plugins add-module-exports \
  --source-maps \
  --out-dir dist/common \
  dist/src

# generating the UMD module files
babel --presets es2015 \
  --plugins add-module-exports,transform-es2015-modules-umd \
  --source-maps \
  --out-dir dist/amd \
  dist/src

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

No branches or pull requests

1 participant