Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default {
- input: `src/${libraryName}.ts`,
- output: [
- { file: pkg.main, name: camelCase(libraryName), format: 'cjs', sourcemap: true },
- { file: pkg.module, format: 'es', sourcemap: true },
- ],
- ....
- }
- var x = require('libname').X
- console.log(x) // This is undefined
- exports.X = X;
- module.exports.X = X;
- console.log(require('libname')
- export default {
- ...
- output: [
- { file: pkg.main, name: camelCase(libraryName), format: 'cjs',
- sourcemap: true,
- outro: 'module.exports = Object.assign({}, module.exports, exports)'
- }
- ]
- ...
- }
Add Comment
Please, Sign In to add comment