-
Notifications
You must be signed in to change notification settings - Fork 381
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
mpx转化快手小程序 #997
base: master
Are you sure you want to change the base?
mpx转化快手小程序 #997
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const BEHAVIORS_MAP = { | ||
'wx://form-field': 'ks://form-field', | ||
'wx://form-field-group': 'ks://form-field-group', | ||
'wx://form-field-button': 'ks://form-field-button', | ||
'wx://component-export': 'ks://component-export' | ||
} | ||
|
||
export default { | ||
convert (options) { | ||
if (options.behaviors) { | ||
options.behaviors.forEach((behavior, idx) => { | ||
if (typeof behavior === 'string' && BEHAVIORS_MAP[behavior]) { | ||
options.behaviors.splice(idx, 1, BEHAVIORS_MAP[behavior]) | ||
} | ||
}) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,7 @@ export function getEnvObj () { | |
return qa | ||
case 'dd': | ||
return dd | ||
case 'ks': | ||
return ks | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ module.exports = function loader (content, prevOptions) { | |
this._module.addPresentationalDependency(new RecordResourceMapDependency(resourcePath, 'staticResource', outputPath, packageRoot)) | ||
} | ||
|
||
let publicPath = `__webpack_public_path__ + ${JSON.stringify(url)}` | ||
let publicPath = options.mode === 'ks'&& queryObj?.currentName ==='app' ? JSON.stringify(url) :`__webpack_public_path__ + ${JSON.stringify(url)}` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. currentName哪来的 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. app中不能用绝对路径? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 在file-loader中加的currentName 这个我可能没复制全 app中的路径用绝对路径解析不出来 |
||
|
||
if (options.publicPath) { | ||
if (typeof options.publicPath === 'function') { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,7 +250,7 @@ module.exports = function (content) { | |
let ctor = 'App' | ||
if (ctorType === 'page') { | ||
// swan也默认使用Page构造器 | ||
if (mpx.forceUsePageCtor || mode === 'ali' || mode === 'swan') { | ||
if (mpx.forceUsePageCtor || mode === 'ali' || mode === 'swan' || mode === 'ks') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 快手不支持component构造页面吗 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个我再确认一下 |
||
ctor = 'Page' | ||
} else { | ||
ctor = 'Component' | ||
|
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.
快手不支持下划线开头的方法是吧
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.
是的