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 output bundler unminified #772

Merged
merged 11 commits into from
Dec 30, 2024
Merged

Conversation

Jinbao1001
Copy link
Member

No description provided.

@Jinbao1001 Jinbao1001 requested a review from PeachScript August 21, 2024 12:57
filename:
output.filename || `${getAutoBundleFilename(pkg.name)}.min.js`,
// default to output dist
path: output.path || 'dist/umd',
Copy link
Member

Choose a reason for hiding this comment

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

这部分还是可以继续放在公共配置里?

src/builder/config.ts Show resolved Hide resolved
const entryOutput =
typeof outputConfig === 'object'
? outputConfig
: { path: outputConfig };

configs.push({
const unminifiedConfig = {
Copy link
Member

Choose a reason for hiding this comment

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

如果没有 generateUnminified 就没必要生成对应配置吧,感觉流程上还是这样清晰?

configs.push(/* 压缩配置 */);

if (generateUnminified) {
  configs.push(/* 非压缩配置 */)
}

@@ -1,6 +1,6 @@
{
"name": "create-father",
"version": "4.5.0",
"version": "4.5.1-beta.3",
Copy link
Member

Choose a reason for hiding this comment

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

这个版本号是误提交的?

filename: output.filename
? `${output.filename}.js`
: `${defaultFileName}.js`,
path: output.path || 'dist/umd',
Copy link
Member

Choose a reason for hiding this comment

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

这个默认值还是写了多次;可以 bundlerConfig.output.path 有个默认值,后续各配置生成的时候优先取配置里的,兜底到默认值

src/builder/config.ts Outdated Show resolved Hide resolved
src/builder/config.ts Outdated Show resolved Hide resolved
@Jinbao1001 Jinbao1001 merged commit 0cdea25 into master Dec 30, 2024
7 checks passed
@Jinbao1001 Jinbao1001 deleted the feat/umd-minify-config branch December 30, 2024 08:47
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.

2 participants