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

有单独的 JS API 么? #255

Closed
muuyao opened this issue Nov 13, 2023 · 3 comments
Closed

有单独的 JS API 么? #255

muuyao opened this issue Nov 13, 2023 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@muuyao
Copy link

muuyao commented Nov 13, 2023

因为不一定会使用 webpack/vite/gulp,可能是直接 nodejs 去构建的

@muuyao muuyao added the question Further information is requested label Nov 13, 2023
@muuyao muuyao changed the title 有单独的 js API 么? 有单独的 JS API 么? Nov 13, 2023
@sonofmagic
Copy link
Owner

嗯,可以直接暴露出相关的js api,目前的构想是,我暴露出一个 createContext 方法,接受插件的参数:

const ctx = createContext(options)
// 接收参数都是字符串 code
ctx.handleWxml(wxmlCode)
ctx.handleJs(jsCode)
ctx.handleWxss(wxssCode)

你看这种方式能满足你这个需求嘛?

@muuyao
Copy link
Author

muuyao commented Nov 13, 2023

满足,想要的就是这个

@sonofmagic
Copy link
Owner

sonofmagic commented Nov 13, 2023

我在新发布的 2.11.0 里,把这个 api 加进去了,使用方法见:

https://weapp-tw.icebreaker.top/docs/quick-start/frameworks/api

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

No branches or pull requests

2 participants