mini-program-global-runtime-webpack-plugin
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -9,6 +9,7 @@ "use strict"; | ||
class MiniProgramGlobalProperty extends RuntimeModule { | ||
constructor(globalObject) { | ||
constructor(globalObject, chunkLoadingGlobal = "miniProgramChunk") { | ||
super("global"); | ||
this.globalObject = globalObject || "global"; | ||
this.chunkLoadingGlobal = chunkLoadingGlobal; | ||
} | ||
@@ -25,2 +26,4 @@ | ||
`my.__mini_program_global__=${this.globalObject};`, | ||
`my.__async_require__=${RuntimeGlobals.require};`, | ||
`my.__chunk_name__=${this.chunkLoadingGlobal};`, | ||
"}", | ||
@@ -35,2 +38,4 @@ "if (typeof wx !== 'undefined' && wx) {", | ||
`wx.__mini_program_global__=${this.globalObject};`, | ||
`wx.__async_require__=${RuntimeGlobals.require};`, | ||
`wx.__chunk_name__=${this.chunkLoadingGlobal};`, | ||
]), | ||
@@ -42,3 +47,3 @@ "}", | ||
`${this.globalObject}.setTimeout=setTimeout;`, | ||
`${this.globalObject}.Infinity=Infinity`, | ||
`${this.globalObject}.Infinity=Infinity;`, | ||
`${this.globalObject}.Array=Array;`, | ||
@@ -45,0 +50,0 @@ `${this.globalObject}.Boolean=Boolean;`, |
{ | ||
"name": "mini-program-global-runtime-webpack-plugin", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "生成小程序全局变量", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8761
182
0