<commit_before>const spawn = require('child_process').spawn
const path = require('path')
const fs = require('fs')
const createWriteStream = require('fs-write-stream-atomic')
const browserify = require('browserify')
const watchify = require('watchify')
const aliasify = require('aliasify')
const babelify = require('babelify')

const port = process.env.PORT || 8080

const b = browserify({
  cache: {},
  packageCache: {},
  debug: true,
  entries: path.join(__dirname, './main.js')
})

b.plugin(watchify)

b.transform(babelify)
b.transform(aliasify, {
  aliases: {
    '@uppy': path.join(__dirname, '../../packages/@uppy')
  }
})

function bundle () {
  return b.bundle()
    .pipe(createWriteStream(path.join(__dirname, './bundle.js')))
}

b.on('log', console.log)
b.on('update', bundle)
b.on('error', console.error)

bundle()

fs.createReadStream(path.join(__dirname, '../../packages/uppy/dist/uppy.min.css'))
  .pipe(fs.createWriteStream(path.join(__dirname, './uppy.min.css')))

// Start the PHP delevopment server.
spawn('php', ['-S', `localhost:${port}`], {
  stdio: 'inherit'
})<commit_msg>Tweaks to aws-presigned-url example so it doesn't hide build errors<commit_after>const spawn = require('child_process').spawn
const path = require('path')
const fs = require('fs')
const createWriteStream = require('fs-write-stream-atomic')
const browserify = require('browserify')
const watchify = require('watchify')
const aliasify = require('aliasify')
const babelify = require('babelify')

const port = process.env.PORT || 8080

const b = browserify({
  cache: {},
  packageCache: {},
  debug: true,
  entries: path.join(__dirname, './main.js')
})

b.plugin(watchify)

b.transform(babelify)
b.transform(aliasify, {
  aliases: {
    '@uppy': path.join(__dirname, '../../packages/@uppy')
  }
})

function bundle () {
  return b.bundle((err, data) => {
    if (err) console.error(err.stack)
    else console.log('bundle complete')
  }).pipe(createWriteStream(path.join(__dirname, './bundle.js')))
}

b.on('log', console.log)
b.on('update', bundle)
b.on('error', console.error)

fs.createReadStream(path.join(__dirname, '../../packages/uppy/dist/uppy.min.css'))
  .pipe(fs.createWriteStream(path.join(__dirname, './uppy.min.css')))

console.log('bundling...')
bundle().on('finish', () => {
  // Start the PHP delevopment server.
  spawn('php', ['-S', `localhost:${port}`], {
    stdio: 'inherit'
  })
})
{'fraction_non_alphanumeric': 0.19633180491871613, 'fraction_numerical': 0.003334722801167153, 'mean_word_length': 4.727923627684964, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6183104', 'n_tokens_mistral': 820, 'n_tokens_neox': 814, 'n_words': 161}