Guest User

Untitled

a guest
Sep 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. export default {
  2. input: `src/${libraryName}.ts`,
  3. output: [
  4. { file: pkg.main, name: camelCase(libraryName), format: 'cjs', sourcemap: true },
  5. { file: pkg.module, format: 'es', sourcemap: true },
  6. ],
  7.  
  8. ....
  9. }
  10.  
  11. var x = require('libname').X
  12. console.log(x) // This is undefined
  13.  
  14. exports.X = X;
  15.  
  16. module.exports.X = X;
  17.  
  18. console.log(require('libname')
  19.  
  20. export default {
  21. ...
  22. output: [
  23. { file: pkg.main, name: camelCase(libraryName), format: 'cjs',
  24. sourcemap: true,
  25. outro: 'module.exports = Object.assign({}, module.exports, exports)'
  26. }
  27. ]
  28. ...
  29. }
Add Comment
Please, Sign In to add comment