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

feat: import内联文件支持原始文件代码可选 #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wunci
Copy link

@wunci wunci commented Oct 12, 2022

No description provided.

@qiansc
Copy link
Contributor

qiansc commented Oct 12, 2022

chore: 更新下文档或示例吧,不知道怎么用。

@wunci
Copy link
Author

wunci commented Oct 12, 2022

使用示例:

 import A from '../../../../static/a.js!script';
// A.code 会返回A文件内容,A还会返回其他字段:path、type等
 import A from '../../../../static/a.js!scriptLink';
// 跟!script的diff:A.code 会返回为空,业务方只使用A.path完成业务

使用!script会把文件内容内联到引入的文件内,但是很多场景只需要静态的地址,一直追加import文件会导致当前文件特别大,所以新增只需要链接的方式!scriptLink,控制代码不内联,code返回为空

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants