Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

feat: web端支持自定义模板 #1115

Merged
merged 6 commits into from
Jul 9, 2020

Conversation

JesuisTong
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Jun 24, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/remaxjs/remax/9mgj4n6b9
✅ Preview: https://remax-git-fork-jesuistong-feat-custom-web-template.remaxjs.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 24, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9bfed21:

Sandbox Source
remaxjs/examples: one Configuration

@@ -94,7 +94,7 @@ export default function webpackConfig(api: API, options: Options): webpack.Confi

config.plugin('html-webpack-plugin').use(HtmlWebpackPlugin, [
{
template: path.resolve(__dirname, '../../../template/index.html.ejs'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是直接通过 configWebpack 修改 html-webpack-plugin 就可以满足需求了?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是直接通过 configWebpack 修改 html-webpack-plugin 就可以满足需求了?

是的是的。自己接管就好了。
不过不能更改根节点的id(虽然感觉这是伪需求)。

@yesmeck
Copy link
Member

yesmeck commented Jun 28, 2020

@vercel vercel bot temporarily deployed to Preview June 28, 2020 04:11 Inactive
@codecov
Copy link

codecov bot commented Jun 28, 2020

Codecov Report

Merging #1115 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1115      +/-   ##
==========================================
+ Coverage   95.27%   95.29%   +0.02%     
==========================================
  Files         350      351       +1     
  Lines        3682     3698      +16     
  Branches      515      521       +6     
==========================================
+ Hits         3508     3524      +16     
  Misses        172      172              
  Partials        2        2              
Impacted Files Coverage Δ
packages/remax-cli/src/build/webpack/config.web.ts 96.66% <100.00%> (+0.11%) ⬆️
packages/remax-runtime/src/VNode.ts 100.00% <0.00%> (ø)
packages/remax-runtime/src/index.ts 100.00% <0.00%> (ø)
packages/remax-runtime/src/createPageConfig.ts 100.00% <0.00%> (ø)
packages/remax-runtime/src/createPageWrapper.ts 100.00% <0.00%> (ø)
...ackages/remax-ali/src/hostComponents/Video/node.ts 100.00% <0.00%> (ø)
...ckages/remax-ali/src/hostComponents/Video/index.ts 100.00% <0.00%> (ø)
...kages/remax-wechat/src/hostComponents/View/node.ts 100.00% <0.00%> (ø)
...emax-runtime/src/SyntheticEvent/stopPropagation.ts 100.00% <0.00%> (ø)
packages/remax-runtime/src/PageInstanceContext.ts
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7547c1...9bfed21. Read the comment docs.

@yesmeck
Copy link
Member

yesmeck commented Jul 2, 2020

@JesuisTong CRA 的 cli 跟脚手架是绑定的,所以可以这么做。我们不行的。

@JesuisTong
Copy link
Contributor Author

@JesuisTong CRA 的 cli 跟脚手架是绑定的,所以可以这么做。我们不行的。

俺不太明白。。🤦‍♀️

@yesmeck
Copy link
Member

yesmeck commented Jul 2, 2020

就是对我们来说直接去读 public/index.html 对已有的项目是个 breaking change

@JesuisTong
Copy link
Contributor Author

就是对我们来说直接去读 public/index.html 对已有的项目是个 breaking change

哦哦,那感觉最好还是用参数控制来显式的声明一下template的path?

@yesmeck
Copy link
Member

yesmeck commented Jul 2, 2020

那没必要,就现在这样挺好的。文档补一下就可以了。

@JesuisTong
Copy link
Contributor Author

🙆

@Darmody
Copy link
Contributor

Darmody commented Jul 2, 2020

就是对我们来说直接去读 public/index.html 对已有的项目是个 breaking change

我们现在如果 public 目录里有 index.html 就是会覆盖掉默认的 index.html 吧?

@@ -91,10 +91,12 @@ export default function webpackConfig(api: API, options: Options): webpack.Confi
.plugin('webpack-copy-plugin')
.use(CopyPlugin, [[{ from: publicDirPath, to: path.join(options.cwd, options.output) }]]);
}

console.log(path.join(publicDirPath, 'index.html'), options.cwd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(path.join(publicDirPath, 'index.html'), options.cwd);

Comment on lines 44 to 48

<!-- TODO: 这个写什么版本? -->

> 2.6.0 开始支持

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<!-- TODO: 这个写什么版本? -->
> 2.6.0 开始支持
> 2.7.0 开始支持

@Darmody
Copy link
Contributor

Darmody commented Jul 6, 2020

LGTM

@vercel vercel bot temporarily deployed to Preview July 6, 2020 14:04 Inactive
@Darmody Darmody merged commit c602637 into remaxjs:master Jul 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants