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/support js entry bundle #5615

Merged
merged 35 commits into from
Dec 19, 2022
Merged

Conversation

answershuto
Copy link
Collaborator

@answershuto answershuto commented Nov 24, 2022

抽象入口文件生成能力,支持 JS entry 平台的构建。

增加用户配置

export default defineConfig(() => ({
  output: {
    distType: ['html', 'javascript'],  // 默认 ['html']
  },
}));

新增产物

about.html 同层级目录下新增 js 入口 产物 about.js

html 与 js 分包

通过自定义 Script 组件实现如下 script 标签,会被构建成立即执行函数:

<script>
  console.log(111);
</script>
(function () {
  console.log(111);
})();

build 的构建产物:

image

DEV 环境调试:

image

@answershuto answershuto changed the title [WIP]Feat/support js entry bundle Feat/support js entry bundle Nov 25, 2022
packages/ice/src/config.ts Show resolved Hide resolved
packages/runtime/src/domRender.ts Outdated Show resolved Hide resolved
@ClarkXia ClarkXia changed the base branch from master to release/3.0 December 1, 2022 04:20
@wssgcg1213 wssgcg1213 changed the base branch from release/3.0 to release/3.1.0 December 14, 2022 07:51
@wssgcg1213 wssgcg1213 added the weex Weex related label Dec 14, 2022
@answershuto answershuto merged commit a44e145 into release/3.1.0 Dec 19, 2022
@answershuto answershuto deleted the feat/support_js_entry_bundle branch December 19, 2022 03:40
@wssgcg1213 wssgcg1213 mentioned this pull request Jan 9, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
weex Weex related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants