a9870c7cecb6cdd424589a86e99fce25f0743475c00dd93595036ee673134e79512a8e952b0da5d65fcdc573afae424b74624828f1a1578ecd26a7cc243922 1013 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # babel-plugin-transform-es2015-modules-systemjs
  2. > This plugin transforms ES2015 modules to [SystemJS](https://github.com/systemjs/systemjs).
  3. ## Example
  4. **In**
  5. ```javascript
  6. export default 42;
  7. ```
  8. **Out**
  9. ```javascript
  10. System.register([], function (_export, _context) {
  11. return {
  12. setters: [],
  13. execute: function () {
  14. _export("default", 42);
  15. }
  16. };
  17. });
  18. ```
  19. ## Installation
  20. ```sh
  21. npm install --save-dev babel-plugin-transform-es2015-modules-systemjs
  22. ```
  23. ## Usage
  24. ### Via `.babelrc` (Recommended)
  25. **.babelrc**
  26. Without options:
  27. ```json
  28. {
  29. "plugins": ["transform-es2015-modules-systemjs"]
  30. }
  31. ```
  32. With options:
  33. ```json
  34. {
  35. "plugins": [
  36. ["transform-es2015-modules-systemjs", {
  37. // outputs SystemJS.register(...)
  38. "systemGlobal": "SystemJS"
  39. }]
  40. ]
  41. }
  42. ```
  43. ### Via CLI
  44. ```sh
  45. babel --plugins transform-es2015-modules-systemjs script.js
  46. ```
  47. ### Via Node API
  48. ```javascript
  49. require("babel-core").transform("code", {
  50. plugins: ["transform-es2015-modules-systemjs"]
  51. });
  52. ```