Socket
Socket
Sign inDemoInstall

mini-program-global-runtime-webpack-plugin

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini-program-global-runtime-webpack-plugin - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

9

lib/module/MiniProgramGlobalProperty.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc