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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Jinbao1001
Copy link
Member

No description provided.

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
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