Created
December 31, 2019 21:06
-
-
Save matthewp/59dd4e4f53d1d697168d67a97d9a9867 to your computer and use it in GitHub Desktop.
Minimal example
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
out.mjs | |
node_modules/ |
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
import * as joi from './joi'; | |
const out = { joi }; | |
export { | |
out as default | |
} |
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
const Schemas = require('./schemas'); | |
exports = module.exports = {}; | |
exports.object = function() { | |
return {}; | |
}; | |
exports.check = function() { | |
return Schemas.check(); | |
}; |
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
{ | |
"name": "rollup-joi", | |
"version": "1.0.0", | |
"lockfileVersion": 1, | |
"requires": true, | |
"dependencies": { | |
"@rollup/plugin-commonjs": { | |
"version": "11.0.0", | |
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.0.0.tgz", | |
"integrity": "sha512-jnm//T5ZWOZ6zmJ61fReSCBOif+Ax8dHVoVggA+d2NA7T4qCWgQ3KYr+zN2faGEYLpe1wa03IzvhR+sqVLxUWg==", | |
"dev": true, | |
"requires": { | |
"@rollup/pluginutils": "^3.0.0", | |
"estree-walker": "^0.6.1", | |
"is-reference": "^1.1.2", | |
"magic-string": "^0.25.2", | |
"resolve": "^1.11.0" | |
} | |
}, | |
"@rollup/pluginutils": { | |
"version": "3.0.1", | |
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.0.1.tgz", | |
"integrity": "sha512-PmNurkecagFimv7ZdKCVOfQuqKDPkrcpLFxRBcQ00LYr4HAjJwhCFxBiY2Xoletll2htTIiXBg6g0Yg21h2M3w==", | |
"dev": true, | |
"requires": { | |
"estree-walker": "^0.6.1" | |
} | |
}, | |
"@types/estree": { | |
"version": "0.0.39", | |
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", | |
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", | |
"dev": true | |
}, | |
"@types/node": { | |
"version": "13.1.2", | |
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.2.tgz", | |
"integrity": "sha512-B8emQA1qeKerqd1dmIsQYnXi+mmAzTB7flExjmy5X1aVAKFNNNDubkavwR13kR6JnpeLp3aLoJhwn9trWPAyFQ==", | |
"dev": true | |
}, | |
"acorn": { | |
"version": "7.1.0", | |
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", | |
"integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", | |
"dev": true | |
}, | |
"estree-walker": { | |
"version": "0.6.1", | |
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", | |
"integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", | |
"dev": true | |
}, | |
"is-reference": { | |
"version": "1.1.4", | |
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", | |
"integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==", | |
"dev": true, | |
"requires": { | |
"@types/estree": "0.0.39" | |
} | |
}, | |
"magic-string": { | |
"version": "0.25.4", | |
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.4.tgz", | |
"integrity": "sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw==", | |
"dev": true, | |
"requires": { | |
"sourcemap-codec": "^1.4.4" | |
} | |
}, | |
"path-parse": { | |
"version": "1.0.6", | |
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", | |
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", | |
"dev": true | |
}, | |
"resolve": { | |
"version": "1.14.1", | |
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.1.tgz", | |
"integrity": "sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg==", | |
"dev": true, | |
"requires": { | |
"path-parse": "^1.0.6" | |
} | |
}, | |
"rollup": { | |
"version": "1.27.14", | |
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.14.tgz", | |
"integrity": "sha512-DuDjEyn8Y79ALYXMt+nH/EI58L5pEw5HU9K38xXdRnxQhvzUTI/nxAawhkAHUQeudANQ//8iyrhVRHJBuR6DSQ==", | |
"dev": true, | |
"requires": { | |
"@types/estree": "*", | |
"@types/node": "*", | |
"acorn": "^7.1.0" | |
} | |
}, | |
"sourcemap-codec": { | |
"version": "1.4.6", | |
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz", | |
"integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", | |
"dev": true | |
} | |
} | |
} |
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
{ | |
"name": "rollup-joi", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"build": "rollup -c rollup.config.js" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": {}, | |
"devDependencies": { | |
"@rollup/plugin-commonjs": "^11.0.0", | |
"rollup": "^1.27.14" | |
} | |
} |
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
import commonjs from '@rollup/plugin-commonjs'; | |
export default { | |
input: 'index.js', | |
output: { | |
file: 'out.mjs', | |
format: 'es' | |
}, | |
plugins: [ | |
commonjs() | |
] | |
}; |
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
const Joi = require('./joi'); | |
const options = { | |
foo: Joi.object() | |
} | |
exports.schemas = { | |
default: options | |
}; |
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
<!doctype html> | |
<html lang="en"> | |
<script type="module"> | |
import * as main from './out.mjs'; | |
console.log(main); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment