Created
December 16, 2016 14:49
-
-
Save hiddenboox/fd7d54843b7f56cfa59f78d7a3b8d64b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// move to main.js | |
define(['utils/array', 'react'], function (array, React) { | |
React.render(); | |
}); | |
// move to index.js | |
const rollup = require('rollup'); | |
const amd = require('rollup-plugin-amd'); | |
const fs = require('fs'); | |
const writeES6Module = ({ modules: [module] }) => fs.writeFile('main.amd.js', module.code, function (err) { | |
if (err) return console.log(err); | |
}); | |
rollup.rollup({ | |
entry: 'main.js', | |
plugins: [ | |
amd() | |
] | |
}).then(writeES6Module); | |
// then run "node index" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment