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

外部模块也支持资源扩展 #18303

Open
hubluesky opened this issue Feb 8, 2025 · 2 comments
Open

外部模块也支持资源扩展 #18303

hubluesky opened this issue Feb 8, 2025 · 2 comments
Labels
Feature Request Needs Triage Needs to be assigned by the team

Comments

@hubluesky
Copy link

hubluesky commented Feb 8, 2025

Use Case

我有一个外部模块存放在项目根目录的node_modules/mvplayable当中,代码享受import { anything } from "mvplayable";但这只有代码才有,我这个外部模块还带有effect等其它资源无法被项目使用。

Image

Problem Description

我想让这个外包模块也跟扩展一样,支持asset-db资源显示功能,就是我在package.json里面添加以下内容,资源管是器能显示我这个资源的内容。

  "contributions": {
        "asset-db": {
            "mount": {
                "path": "./assets",
                "readonly": true
            }
        }
    }

Proposed Solution

No response

How it works

No response

Alternatives Considered

目前方案就是一个是外部模块,代码放到node_modules里面,然后再创建一个扩展,把资源放到扩展里面,感觉很不方便。

Additional Information

No response

@hubluesky hubluesky added Feature Request Needs Triage Needs to be assigned by the team labels Feb 8, 2025
@a1076559139
Copy link

可以参看xforge框架中扩展包的方案,跟你的需求基本一致
https://gitee.com/cocos2d-zp/xforge/wikis/pages?sort_id=13017465&doc_id=6236543

官方支持的话,就得编辑器去扫node_modules,识别里面符合插件规则的包
到时候,extensions由CocosStore维护,node_modules由npm维护,想想其实也挺好,就是不知道官方怎么看或者打算什么时候支持了

@hubluesky
Copy link
Author

可以参看xforge框架中扩展包的方案,跟你的需求基本一致 https://gitee.com/cocos2d-zp/xforge/wikis/pages?sort_id=13017465&doc_id=6236543

官方支持的话,就得编辑器去扫node_modules,识别里面符合插件规则的包 到时候,extensions由CocosStore维护,node_modules由npm维护,想想其实也挺好,就是不知道官方怎么看或者打算什么时候支持了

我想extensions已经支持了,node_modules支持应该问题不大,这种扩展的功能使用起来还是挺方便的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

2 participants