Yup: Add UMD build

Created on 5 Jul 2017  路  6Comments  路  Source: jquense/yup

Selfishly want this for forthcoming Formik docs site.

Most helpful comment

Why was this issue closed? We're also looking for a UMD build of Yup, and there seem to be people interested in helping out adding support for this?

All 6 comments

@jquense would you merge a PR that updates tooling with Rollup and adds this?

Sure!

I need this badly as well. Please build a UMD that can be accessed via https://unpkg.com/.

Some initial thoughts on resolving this issue:

  • Update rollup.config.js to output a UMD bundle:
diff --git a/rollup.config.js b/rollup.config.js
index 442db4e..ae8c725 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -38,6 +38,11 @@ module.exports = [
         file: 'dist/yup.esm.js',
         format: 'es',
       },
+      {
+        file: 'dist/yup.umd.js',
+        format: 'umd',
+        name: 'Yup',
+      },
     ],
     plugins: [...base.plugins, filesize()],
   },

  • Update package.json#main to point to the UMD bundle instead of the CommonJS bundle (possibly?)
  • Update the build npm script to run Rollup in some way

What else might be involved here? Interested in helping resolve this.

Why was this issue closed? We're also looking for a UMD build of Yup, and there seem to be people interested in helping out adding support for this?

This is still very much relevant :+1:

Was this page helpful?
0 / 5 - 0 ratings