-
Notifications
You must be signed in to change notification settings - Fork 70
Feat: support disable doctype #193
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
Conversation
|
可以不需要单独出 web,文档注释上说明即可 |
| this.command = options.command; | ||
|
|
||
| // Disable doctype in `build.json` | ||
| this.doctype = options.doctype === 'none' ? '' : '<!DOCTYPE html>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么不是 null ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
考虑这样
if (options.doctype == null) {
this.doctype = '';
} else {
this.doctype = options.doctype;
}
options.doctype 的默认值为 ''
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认值不能设为 '', 是 breakchange 且用户无感知的
| this.command = options.command; | ||
|
|
||
| // Disable doctype in `build.json` | ||
| this.doctype = options.doctype === null ? '' : `<!DOCTYPE ${options.doctype || 'html'}>`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果有值,全部由用户来定制即可,这样逻辑上甚至可以支持 xml, <?xml version="1.0" encoding="UTF-8"?>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
#185
Usage
disable doctype
{ "plugins": [ [ "build-plugin-rax-app", { "targets": ["web"], "doctype": null } ] ] }custom doctype