ember-cli / ember-cli/babel-plugin-debug-macros

Strip import statement if all imports are removed.

Đang mở
#28 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
13
Fork
13
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Currently, given:

```js
import { SOME_FLAG } from 'blah/features';

if (SOME_FLAG) {
console.log('whatever');
}
```

With this config:

```js
{
plugins: [
['babel-debug-macros', {
features: {
name: 'blah',
source: 'blah/features',
flags: { SOME_FLAG: true }
},
}]
]
}
```

We remove the usage of `SOME_FLAG`, but leave the import statement. This forces us to also emit a `blah/features` module even if we never have runtime enableable features.

IMO, we should remove imports if they are no longer used...

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.