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: 🎸 report size #335

Merged
merged 5 commits into from
Apr 25, 2022
Merged

feat: 🎸 report size #335

merged 5 commits into from
Apr 25, 2022

Conversation

maoxiaoke
Copy link
Collaborator

@maoxiaoke maoxiaoke requested review from ClarkXia and imsobear April 22, 2022 08:47
@@ -48,7 +52,7 @@ export type PkgPluginAPI = IPluginAPI<TaskConfig>;

export type PkgPlugin = IPlugin<TaskConfig>;

export type TaskName = 'pkg-cjs' | 'pkg-esm' | 'pkg-es2017' | 'pkg-dist-es5' | 'pkg-dist-es2017';
export type TaskName = 'cjs' | 'esm' | 'es2017' | 'dist-es5' | 'dist-es2017';
Copy link
Member

Choose a reason for hiding this comment

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

  • cjs -> transform-cjs
  • dist-es5 -> bundle-es5

这样会好点吗?

Copy link
Member

Choose a reason for hiding this comment

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

我看好多地方用到这个变量,建议通过 constants 抽象掉,改起来也好改一些。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

packages/pkg/src/loaders/transform.ts Outdated Show resolved Hide resolved
packages/pkg/src/loaders/bundle.ts Outdated Show resolved Hide resolved
@maoxiaoke maoxiaoke requested review from imsobear and ClarkXia April 24, 2022 03:33
@maoxiaoke maoxiaoke changed the base branch from master to rc/release April 24, 2022 03:34
// Configure task outputDir(Taskname 以 pkg-[cjs|esm|es2017 命名])
normalizedConfig.outputDir = outputDir || join(rootDir, taskName.split('-')[1]);
// Configure task outputDir
normalizedConfig.outputDir = outputDir || getOutputDir(rootDir, taskName as TaskName);
Copy link
Contributor

Choose a reason for hiding this comment

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

ctx 已经定义了 PkgContext,这里的 TaskName 的断言是不是多余了

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

嗯,build-scripts 返回的还是 string 类型,需要支持一下

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@maoxiaoke maoxiaoke merged commit f398268 into rc/release Apr 25, 2022
@maoxiaoke maoxiaoke deleted the feat/report-size branch April 25, 2022 07:02
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.

3 participants