-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser-ready dist/ folder? #3
Comments
@chriscalo Hello! Sounds good. I do that with my latest libs, but at the time I didn't have the build setup that I share with my newer packages. In the meantime, something like the following should work (haven't tested it): <script>
var module = { exports: {} }
var exports = module.exports
</script>
<script src="https://unpkg.com/regexr@1.3.0/regexr.js"></script> then |
Alright, done! Try the following: <script src="https://unpkg.com/regexr@1.4.3/global.js"></script>
<script>
const r = regexr.default // grab the default export from the global
console.log(r`/foo/` instanceof RegExp) // true
</script> |
Hmmm, wait, something didn't work as expected when I tested locally. |
Alright fixed it in v1.4.4. Try: <script src="https://unpkg.com/regexr@1.4.4/global.js"></script>
<script>
const r = regexr.default // grab the default export from the global
console.log(r`/foo/` instanceof RegExp)
</script> |
Working for me. Thanks, @trusktr 🙏 |
Any chance I can convince you to publish a browser-ready
dist/
folder to npm? That makes it possible to use your library without a build step via unpkg.com, for example:The text was updated successfully, but these errors were encountered: