Unsuccessful attempt to reproduce http://stackoverflow.com/questions/34973542/rollup-js-undefined-objects-in-external-dependencies. Clone, npm install
, npm test
.
-
-
Save Rich-Harris/160a65c5c8ce6feb7337 to your computer and use it in GitHub Desktop.
attempt to reproduce SO 34973542
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 SHA256 from 'crypto-js/sha256'; | |
console.log( SHA256( 'hello' ) ); |
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
{ | |
"devDependencies": { | |
"rollup": "^0.25.1", | |
"rollup-plugin-commonjs": "^2.2.0", | |
"rollup-plugin-npm": "^1.3.0" | |
}, | |
"scripts": { | |
"build": "rollup -c", | |
"pretest": "npm run build", | |
"test": "node bundle.js" | |
}, | |
"dependencies": { | |
"crypto-js": "^3.1.6" | |
} | |
} |
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 npm from 'rollup-plugin-npm'; | |
import commonjs from 'rollup-plugin-commonjs'; | |
export default { | |
entry: 'main.js', | |
format: 'cjs', | |
plugins: [ | |
npm({ | |
jsnext: true, | |
main: true, | |
}), | |
commonjs() | |
], | |
dest: 'bundle.js', | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment