-
-
Notifications
You must be signed in to change notification settings - Fork 948
Closed
Description
The UUID generator can be built to a browser application using browserify, webpack, rollup or similar other bundler. However, if the application is built from pure JavaScript modules or AMD modules, this package cannot be used without an additional bundling work. (Scripts published from the NPM package cannot be loaded by the script element on a web page.)
How about including UMD modules in the NPM package, so that browser applications could load them directly, without each of them building such module themselves internally?
For example, by importing the UUID generator function globally:
<script src="https://unpkg.com/uuid@3.4.0/browser/v1.min.js"></script>
<script>
var id = uuidv1();
console.log(id);
</script>Another example, requiring the UUID generator as an AMD module (using RequireJS, for example):
<script src="https://unpkg.com/requirejs@2.3.6/require.js"></script>
<script>
require.config({
paths: {uuidv4: 'https://unpkg.com/uuid@3.4.0/browser/v4.min'}
});
require(['uuidv4'], function(uuid) {
var id = uuid();
console.log(id);
});
</script>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels