提交 002161aa 编写于 作者: fxy060608's avatar fxy060608

chore: build

上级 ff8b2a56
......@@ -22,7 +22,7 @@ function fix2648(bundle) {
}
try {
const { usingComponents } = JSON.parse(appJsonAsset.source.toString());
if (usingComponents && !Object.keys(usingComponents).length) {
if (usingComponents && usingComponents['fix-2648']) {
fs__default["default"].outputFileSync(path__default["default"].resolve(process.env.UNI_OUTPUT_DIR, 'fix-2648.json'), `{"component":true}`);
fs__default["default"].outputFileSync(path__default["default"].resolve(process.env.UNI_OUTPUT_DIR, 'fix-2648.qml'), `<!-- https://github.com/dcloudio/uni-app/issues/2648 -->`);
fs__default["default"].outputFileSync(path__default["default"].resolve(process.env.UNI_OUTPUT_DIR, 'fix-2648.js'), `Component({})`);
......@@ -134,6 +134,16 @@ const options = {
app: {
darkmode: false,
subpackages: true,
normalize(appJson) {
const hasUsingComponents = appJson.usingComponents && Object.keys(appJson.usingComponents).length;
if (!hasUsingComponents) {
// fix https://github.com/dcloudio/uni-app/issues/2648
appJson.usingComponents = {
'fix-2648': '/fix-2648',
};
}
return appJson;
},
},
project: {
filename: 'project.config.json',
......
......@@ -939,12 +939,7 @@ const createApp = initCreateApp();
const createPage = initCreatePage(parseOptions);
const createComponent = initCreateComponent(parseOptions);
const createPluginApp = initCreatePluginApp();
const createSubpackageApp = initCreateSubpackageApp();
wx.createApp = global.createApp = createApp;
wx.createPage = createPage;
wx.createComponent = createComponent;
wx.createPluginApp = createPluginApp;
wx.createSubpackageApp = createSubpackageApp;
const createSubpackageApp = initCreateSubpackageApp();
qq.EventChannel = EventChannel;
qq.createApp = global.createApp = createApp;
......
......@@ -877,10 +877,12 @@ const createPage = initCreatePage(parseOptions);
const createComponent = initCreateComponent(parseOptions);
const createPluginApp = initCreatePluginApp();
const createSubpackageApp = initCreateSubpackageApp();
wx.createApp = global.createApp = createApp;
wx.createPage = createPage;
wx.createComponent = createComponent;
wx.createPluginApp = createPluginApp;
wx.createSubpackageApp = createSubpackageApp;
{
wx.createApp = global.createApp = createApp;
wx.createPage = createPage;
wx.createComponent = createComponent;
wx.createPluginApp = createPluginApp;
wx.createSubpackageApp = createSubpackageApp;
}
export { createApp, createComponent, createPage, createPluginApp, createSubpackageApp };
......@@ -15,8 +15,10 @@ export const createPage = initCreatePage(parseOptions)
export const createComponent = initCreateComponent(parseOptions)
export const createPluginApp = initCreatePluginApp()
export const createSubpackageApp = initCreateSubpackageApp()
;(wx as any).createApp = (global as any).createApp = createApp
;(wx as any).createPage = createPage
;(wx as any).createComponent = createComponent
;(wx as any).createPluginApp = createPluginApp
;(wx as any).createSubpackageApp = createSubpackageApp
if (__PLATFORM__ === 'mp-weixin') {
;(wx as any).createApp = (global as any).createApp = createApp
;(wx as any).createPage = createPage
;(wx as any).createComponent = createComponent
;(wx as any).createPluginApp = createPluginApp
;(wx as any).createSubpackageApp = createSubpackageApp
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册