Skip to main content

App

App config

Each Mini Program has an app.json as the main entry.

Here is a demo of app.json.

{
"pages": ["pages/index/index", "pages/benchmark/index"],
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#001935",
"navigationBarTitleText": "Goji",
"navigationBarTextStyle": "white"
}
}

For more fields, see here .

In addition, Goji provides a JavaScript-based config file called app.config.js. You can use it for better cross-platform support.

module.exports = ({ target }) => ({
pages: ['pages/index/index', 'pages/benchmark/index'],
window: {
backgroundTextStyle: 'dark',
navigationBarBackgroundColor: '#001935',
navigationBarTitleText: `Goji on ${target}`,
navigationBarTextStyle: 'white',
},
});

App script

Same as original app.js. You can add global polyfills in this file.

import 'core-js';

App({});