Pārlūkot izejas kodu

call the global Robodog in CDN build

cc @kvz
Artur Paikin 6 gadi atpakaļ
vecāks
revīzija
227b0f855f
1 mainītis faili ar 11 papildinājumiem un 9 dzēšanām
  1. 11 9
      bin/build-js.js

+ 11 - 9
bin/build-js.js

@@ -10,8 +10,8 @@ function handleErr (err) {
   console.error(chalk.red('✗ Error:'), chalk.red(err.message))
 }
 
-function buildBundle (srcFile, bundleFile, { minify = false } = {}) {
-  var b = browserify(srcFile, { debug: true, standalone: 'Uppy' })
+function buildBundle (srcFile, bundleFile, { minify = false, standalone = '' } = {}) {
+  var b = browserify(srcFile, { debug: true, standalone })
   if (minify) {
     b.plugin(tinyify)
   }
@@ -25,9 +25,9 @@ function buildBundle (srcFile, bundleFile, { minify = false } = {}) {
       .on('error', handleErr)
       .on('finish', function () {
         if (minify) {
-          console.info(chalk.green('✓ Built Minified Bundle:'), chalk.magenta(bundleFile))
+          console.info(chalk.green(`✓ Built Minified Bundle [${standalone}]:`), chalk.magenta(bundleFile))
         } else {
-          console.info(chalk.green('✓ Built Bundle:'), chalk.magenta(bundleFile))
+          console.info(chalk.green(`✓ Built Bundle [${standalone}]:`), chalk.magenta(bundleFile))
         }
         resolve()
       })
@@ -40,22 +40,24 @@ mkdirp.sync('./packages/@uppy/robodog/dist')
 Promise.all([
   buildBundle(
     './packages/uppy/bundle.js',
-    './packages/uppy/dist/uppy.js'
+    './packages/uppy/dist/uppy.js',
+    { standalone: 'Uppy' }
   ),
   buildBundle(
     './packages/uppy/bundle.js',
     './packages/uppy/dist/uppy.min.js',
-    { minify: true }
+    { standalone: 'Uppy', minify: true }
   ),
   buildBundle(
     './packages/@uppy/robodog/bundle.js',
-    './packages/@uppy/robodog/dist/robodog.js'
+    './packages/@uppy/robodog/dist/robodog.js',
+    { standalone: 'Robodog' }
   ),
   buildBundle(
     './packages/@uppy/robodog/bundle.js',
     './packages/@uppy/robodog/dist/robodog.min.js',
-    { minify: true }
+    { standalone: 'Robodog', minify: true }
   )
 ]).then(function () {
-  console.info(chalk.yellow('✓ JS Bundle 🎉'))
+  console.info(chalk.yellow('✓ JS bundles 🎉'))
 })