2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
2. Create a Mini Program
Clear app.wxss and app.js
Remove rendererOptions and componentFramework. No need for the latest search engine.
Leave the following files
4. Custom build npm + integrated Sass
First, put the miniprogram source code file into the newly created miniprogram folder
Configure the miniprogramRoot option in project.config.json to specify the directory of the miniprogram source code
Then configure setting.packNpmManually in project.config.json to true to enable the npm build method with custom node_modules and miniprogram_npm locations.
Right-click on the project and click [Open in built-in terminal] Enter [npm init -y] in the terminal to generate the package.json file
Finally, configure the setting.packNpmRelationList item in project.config.json to specify the location of packageJsonPath and miniprogramNpmDistDir
Modified project.config.json file
{
"compileType": "miniprogram",
"libVersion": "trial",
"packOptions": {
"ignore": [],
"include": []
},
"miniprogramRoot": "miniprogram/",
"setting": {
"packNpmManually": true,
"packNpmRelationList": [
{
"packageJsonPath": "/package.json",
"miniprogramNpmDistDir": "./miniprogram"
}
],
"useCompilerPlugins": [
"sass"
],
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "auto",
"tabSize": 2
},
"appid": "wx34f339ffd16a69e5",
"srcMiniprogramRoot": "miniprogram/"
}