var build = require('./build'), path = require('path'), babelify = require('babelify'), nanohtml = require('nanohtml'), watch = process.argv.includes('--watch'), through = require('through'), minimatch = require('minimatch') var ignores = ['**/*.min.js', '**/jquery.ui.js', 'gyronorm.complete.min.js'], transformWrapper = function(transform){ return function(file, opts){ if (ignores.some(pattern => minimatch(file, pattern))) { return through() } else { return transform(file, opts) } } } var transforms = [ [transformWrapper(nanohtml)], [transformWrapper(babelify)] ] console.warn('\033[36m=> Building compressed client scripts...\033[0m') transforms.push([transformWrapper(require('uglifyify')), {global: true, safari10: true}]) var bundle = build({ input: '../src/client/index.js', output: '../app/client/open-stage-control-client.js', options: { debug: true, insertGlobals: false, noParse: ['**/*.min.js', '**/jquery.ui.js'], cache: {}, packageCache: {}, }, plugins: watch ? [require('watchify')] : [], transforms: transforms, ignore: [ 'postcss' // only needed by sanitize-html if