Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

把特殊全局变量模块化 #302

Open
otakustay opened this issue Jul 25, 2022 · 0 comments
Open

把特殊全局变量模块化 #302

otakustay opened this issue Jul 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@otakustay
Copy link
Member

现在的代码是这样的:

if (skr.features.foo) {
    // 代码
}

console.log(skr.build.target);

模块化以后,期望是这样:

import {foo} from '@skr/features';
import {target} from '@skr/build';

if (foo) {
    // 代码
}

console.log(target);

这个在SWC中可以用constModules搞定,但其它编译方案不知道有没有替代的

@otakustay otakustay added the enhancement New feature or request label Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant