$ npm install konan
Like detective but also supports ES6
import
and more.
yarn add konan
# or hey old school
npm install --save konan
require
callimport/export
ES6 modulesimport()
Dynamic importjsx
syntax by defaultconst konan = require('konan')
konan(`
import React, {Component} from 'react'
const vue = require('vue/dist/vue')
import('./my-async-module').then()
require(path.resolve('./'))
`)
/*
result =>
{
strings: ['react', 'vue/dist/vue', './my-async-module'],
expressions: ['path.resolve(\'./\')']
}
*/
Type: string
object
Required: true
Source content as string or AST tree.
Type: boolean
Default: true
You can disable detecting dynamic import()
-ed modules.
Type: object
Default: {sourceType: 'module', plugins: ['jsx', 'typescript', 'dynamicImport']}
babel parser parse options.
It stands for Meitantei Konan
(名探偵コナン), the main character in Detective Conan.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
konan © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @_egoistlily
© 2010 - cnpmjs.org x YWFE | Home | YWFE