Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/effrenus/babel-plugin-transform-es6-to-ymodule
Transpile es6 module syntax to YModules
https://github.com/effrenus/babel-plugin-transform-es6-to-ymodule
Last synced: about 1 month ago
JSON representation
Transpile es6 module syntax to YModules
- Host: GitHub
- URL: https://github.com/effrenus/babel-plugin-transform-es6-to-ymodule
- Owner: effrenus
- Created: 2016-02-04T14:57:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-05T14:21:35.000Z (almost 9 years ago)
- Last Synced: 2024-11-13T02:11:50.907Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Babel plugin
Transform ES6 module syntax to YModule declarations
## Plugin settings
* `namespace` - modules prefix
## Example
```
//SETMODULE: bubble.layout
import 'Map';
import 'Placemark';var size = [100, 200],
color = 'red';const map = new Map({
center: [55, 45],
zoom: 10
});export function getColor () {
return color;
}export function getMap () {
return map;
}
```transformed to
```
'use strict';ymaps.modules.define('bubble.layout', ['Map', 'Placemark'], function (provide, Map, Placemark) {
var size = [100, 200],
color = 'red';var map = new Map({
center: [55, 45],
zoom: 10
});provide({
'getColor': function getColor() {
return color;
},
'getMap': function getMap() {
return map;
}
});
})
```