alongubkin / alongubkin/spider

Native Require Support

未关闭
#46 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
need-feedback proposal
主要语言
JavaScript
星标
1.3k
派生
46
PR 合并指标
30 天内没有已合并 PR

描述

Add native require support to Spider.
#### Proposed Syntax

```
require "util"

require (
"vm",
"lodash" as _,
"jashkenas/backbone" // GitHub repo
)
```

is compiled to:

```
var util = require("util"),
vm = require("vm"),
_ = require("lodash"),
backbone = require("backbone"); // after the compiler automatically installs the package
```

The `require` statement would also automatically use the added identifier so there's no need for `::` and `use`.
#### Problems
- How does this work in the Browser?
- How to combine this with ES6 modularisation features?
- Should we use [DuoJS](http://duojs.org/) by default (which solves the first issue)?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。