The global problem of Mini Program's front-end use of promise,regeneratorRuntime

how to add regeneratorRuntime attributes globally on global objects, I now have to manually refer to third-party libraries
const regeneratorRuntime = global.regeneratorRuntime = require (".. /.. / vendor/runtime.js")

on every page.
Dec.07,2021

app.js:global.regeneratorRuntime = require ('. / utils/regenerator/runtime-module')
other pages js:const {regeneratorRuntime} = global
this eliminates the need for every page to require, the optimized volume

Menu