Created
October 8, 2016 04:34
-
-
Save lund0n/b0521a02296a563e6714219cb962d1c9 to your computer and use it in GitHub Desktop.
Demonstrate use of CommonJS module in Rollup
This file contains 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
// Just a couple of examples from the crypto-js README. | |
// run with `node bundle.js` after running the rollup build. | |
import CryptoJS from 'crypto-js'; | |
import SHA256 from 'crypto-js/sha256'; | |
console.log(CryptoJS.HmacSHA1('Message', 'Key')); | |
console.log(SHA256('Message')); | |
This file contains 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
import commonjs from 'rollup-plugin-commonjs'; | |
import resolve from 'rollup-plugin-node-resolve'; | |
export default { | |
entry: 'index.js', | |
dest: 'bundle.js', | |
format: 'iife', | |
plugins: [ | |
resolve(), | |
commonjs(), | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment