Skip to content

Commit

Permalink
Use async-to-gen for micro itself as well
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Feb 4, 2017
1 parent 0948023 commit 169fa88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 12 additions & 12 deletions bin/micro.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
// Native
const {resolve} = require('path')

// Package
// Packages
const parse = require('minimist')
const isAsyncSupported = require('is-async-supported')

// Ours
const serve = require('../')

const DEV = 'development' === process.env.NODE_ENV
const asyncToGen = require('async-to-gen/register')

const args = parse(process.argv, {
alias: {
Expand Down Expand Up @@ -61,11 +56,16 @@ if ('/' !== file[0]) {
file = resolve(process.cwd(), file)
}

if (!isAsyncSupported()) {
require('async-to-gen/register')({
sourceMaps: DEV
})
}
// Support for keywords "async" and "await"
const pathSep = process.platform === 'win32' ? '\\\\' : '/'

asyncToGen({
includes: new RegExp(`.*micro?${pathSep}(lib|bin)|${file}.*`),
excludes: null,
sourceMaps: false
})

const serve = require('../')

let mod

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
},
"dependencies": {
"async-to-gen": "1.3.1",
"is-async-supported": "1.2.0",
"isstream": "0.1.2",
"media-typer": "0.3.0",
"minimist": "1.2.0",
Expand Down

0 comments on commit 169fa88

Please sign in to comment.