Information injection method and device using webpack, electronic equipment and storage medium

By building a plug-in structure in webpack and implicitly injecting information, the problem of low security in information injection in compiling front-end projects is solved, and the security concealment of information is achieved and the risk of attack is reduced.

CN119292689APending Publication Date: 2025-01-10PIPECHINA SOUTH CHINA CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411218279.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing information injection methods have problems with low information security and high risk of attack in compiling front-end projects, especially the injected information exists in the form of annotation or global variables, which is easy to be attacked.

Method used

By using webpack to build a plug-in structure, the injected information and loading files are loaded into the plug-in structure to be injected, and injected into the preset target package, implicit injection of information is realized, so that the injected information no longer exists in the web page in plain text form. HTML source code or global variable.

Benefits of technology

Improves the security of information, reduces the risk of being attacked, and makes the injected information finally injected into the target package through the webpack plug-in. The web page HTML source code and global variables are not visible, improving the protection of information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292689A_ABST
    Figure CN119292689A_ABST
Patent Text Reader

Abstract

The invention discloses an information injection method and device using webpack, electronic equipment and a storage medium. The method comprises the following steps: constructing a plug-in structure by using the webpack; mounting the plug-in structure to a webpack to form a plug-in structure to be injected; obtaining a loading file and injection information, and loading the injection information and the loading file to the to-be-injected plug-in structure to obtain a to-be-injected target plug-in; and injecting the to-be-injected target plug-in into a preset target packet to complete implicit injection of the injection information. According to the method and the device, the injection information is finally injected into the target packet in the form of the plug-in by utilizing the webpack, so that the HTML source code and the global variable of the webpage are invisible, the information security is improved, and the attack risk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing technology, and in particular to an information injection method and device using webpack, an electronic device, and a storage medium. Background Art

[0002] Nowadays, injecting additional information has become a norm when compiling front-end projects. Common injected information includes compilation time and compilation branch. There are usually two ways to inject it into the website: inject it into index.html in the form of comments or inject it into a global variable in the window in the form of variables.

[0003] The above two common injection methods, whether injected into index.html or injected into a global variable of window, the injected information is displayed in a specific content style, with low information security and a high risk of being attacked. Summary of the invention

[0004] In order to solve the above problems, the embodiments of the present application provide an information injection method and device using webpack, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] In the first aspect, in order to solve the above technical problems, the present application provides an information injection method using webpack, including:

[0006] Use webpack to build plugin structure;

[0007] Mount the plug-in structure to the webpack to form a plug-in structure to be injected;

[0008] Obtain a loading file and injection information, load the injection information and the loading file into the plug-in structure to be injected, and obtain a target plug-in to be injected;

[0009] The target plug-in to be injected is injected into a preset target package to complete the implicit injection of the injection information.

[0010] The beneficial effects are:

[0011] In the technical solution provided by the embodiment of the present application, webpack is used to build a plug-in structure, and after the plug-in structure is mounted, the injection information and the loading file are loaded into the plug-in structure to be injected to obtain the target plug-in to be injected, and then the injection information is injected into the target package in the form of a plug-in. In this way, the injection information is finally injected into the target package through the webpack plug-in, making the webpage HTML source code and global variables invisible, improving information security and reducing the risk of being attacked.

[0012] In a second aspect, the present invention provides an information injection device using webpack, including a construction unit, a mounting unit, a loading unit and an injection unit;

[0013] Build unit, used to build plugin structure using webpack;

[0014] A mounting unit, used to mount the plug-in structure to the webpack to form a plug-in structure to be injected;

[0015] A loading unit, used for acquiring a loading file and injection information, loading the injection information and the loading file into the plug-in structure to be injected, and obtaining a target plug-in to be injected;

[0016] The injection unit is used to inject the target plug-in to be injected into a preset target package to complete the implicit injection of the injection information.

[0017] In a third aspect, the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the information injection method using webpack as described above.

[0018] In a fourth aspect, the present application also provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor of a computer, the computer executes the information injection method using webpack as described above.

[0019] In a fifth aspect, the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the information injection method using webpack provided in the above various optional embodiments.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 It is a flowchart of an information injection method using webpack shown in an exemplary embodiment of the present application;

[0023] Figure 2 This is a flow chart of packaging using webpack;

[0024] Figure 3 is a block diagram of an information injection device using webpack shown in an exemplary embodiment of the present application;

[0025] Figure 4 It is a schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION

[0026] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0029] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0030] In order to solve the problems of low information security and high risk of attacks in existing information injection methods, the embodiments of the present application propose an information injection method and device using webpack, an electronic device, and a computer-readable storage medium, which mainly involve information injection technology included in information processing technology. These embodiments will be described in detail below.

[0031] First see Figure 1 , Figure 1 This is a flowchart of an exemplary embodiment of the present application showing a method for injecting information using webpack. Figure 1 As shown, in an exemplary embodiment, the information injection method using webpack may include steps S101 to S104, which are described in detail as follows:

[0032] Step S101, using webpack to build a plug-in structure.

[0033] Step S102, mount the plug-in structure to webpack to form a plug-in structure to be injected.

[0034] Step S103, obtaining a loading file and injection information, loading the injection information and loading file into the plug-in structure to be injected, and obtaining a target plug-in to be injected.

[0035] Step S104, injecting the target plug-in to be injected into a preset target package to complete the implicit injection of the injection information.

[0036] Webpack is a static module packaging tool for modern JavaScript applications. Its main function is to build a dependency graph of modules of one or more entry points, and combine each required module into one or more bundles, which are static resources for displaying content. Webpack supports multiple types of loaders and plug-ins, which enables it to handle different file types and provides rich features and configuration options.

[0037] Therefore, in this embodiment, webpack is used to build a plug-in structure, and the injection information is injected into the preset target package by packaging using the plug-in structure, so that the specific content of the injection information can be displayed without displaying the specific content of the injection information, and implicit injection is completed. Therefore, in the method provided in this embodiment, the plug-in structure is built by webpack, and after the plug-in structure is mounted to form the plug-in structure to be injected, the injection information and the loading file are loaded into the plug-in structure to be injected to obtain the target plug-in to be injected, and then the injection information is injected into the target package in the form of a plug-in. In this way, the injection information is finally injected into the target package through the webpack plug-in, so that the specific content of the injection information, the HTML source code of the webpage, and the global variables are all invisible, which improves information security and reduces the risk of being attacked.

[0038] In an exemplary embodiment provided by the present application, webpack constructs a plug-in structure through configuration conditions related to the injection plug-in, and the specific steps may include:

[0039] Read the configuration conditions of webpack;

[0040] Build plugin structure based on configuration conditions.

[0041] In another exemplary embodiment, the configuration condition includes injection content parameters and mounting function parameters. Therefore, the specific steps of building the plug-in structure based on the configuration condition may include:

[0042] Construct an injection content object module based on injection content parameters;

[0043] Build a mount function object module based on the mount function parameters;

[0044] The plug-in structure is obtained based on the injected content object module and the mounted function object module.

[0045] In the above embodiment, in order to construct a plug-in structure that can use webpac to package injection information and realize implicit injection of injection information, a plug-in structure is constructed according to configuration conditions related to the injection plug-in. Specifically, the configuration conditions are first read, including injection content parameters and mount function parameters, and then the injection content object module is constructed based on the injection content parameters, and the mount function object module is constructed based on the mount function parameters, thereby forming a plug-in structure to implement the plug-in structure through the injection content parameters and the mount function parameters. The specific running code is as follows:

[0046]

[0047] Among them, injects represents the injected content, funcName represents the function name mounted to the preset target package (such as document.body). This attribute is optional and the default value is $$getInjectData$$.

[0048] In this embodiment, after extracting the above configuration conditions, the corresponding plug-in is introduced based on the configuration conditions, that is, the plug-in structure is constructed, and the specific running code is as follows:

[0049] JavaScript

[0050] const InjectionPlugin=require('injection-plugin')

[0051] In this way, this embodiment of the present application constructs a plug-in structure through configuration conditions related to the injection plug-in, so that the injection information can be loaded into the constructed plug-in structure, and implicit injection of information is achieved through plug-in injection.

[0052] In an exemplary embodiment provided by the present application, the specific steps of mounting the plug-in structure to webpack to form the plug-in structure to be injected may include:

[0053] Mount the plug-in structure to the first hook of the parser of the JavaScript module in webpack to form a first plug-in structure;

[0054] The first plug-in structure is mounted on the second hook of webpack through the parser to form a second plug-in structure as a plug-in to be injected.

[0055] In another exemplary embodiment, it is necessary to detect and judge the acquired loading file to ensure that the entry file is loaded into the plug-in structure to be injected, so that the injection information can be accessed first. The specific steps may include:

[0056] Check whether the loaded file is an entry file and get the test result;

[0057] If the detection result indicates that the loaded file is an entry file, the loaded file is retained to be loaded into the plug-in structure to be injected;

[0058] If the detection result indicates that the loaded file is not an entry file, the loaded file is acquired again until the corresponding detection result indicates that the loaded file is an entry file.

[0059] In this embodiment, the specific steps of detecting whether the loaded file is an entry file and obtaining the detection result may include:

[0060] Get the original request information for loading files;

[0061] Compare the original request information with the entry point information pre-configured by webpack. When the original request information is consistent with the entry point information, a detection result indicating that the loaded file is an entry file is obtained.

[0062] When the original request information is inconsistent with the entry point information, a detection result is obtained indicating that the loaded file is not the entry file.

[0063] In another exemplary embodiment, after determining that the loading file is an entry file, loading the loading file box injection information into the plug-in structure to be injected may specifically include:

[0064] Generate code to be injected based on injection information;

[0065] The file is loaded into the plug-in structure to be injected, and the code to be injected is loaded into the end of the plug-in structure to be injected, so as to obtain the target plug-in to be injected.

[0066] In the above embodiment, the running code corresponding to the steps of mounting the plug-in structure and loading the injection information and loading the file may be as follows:

[0067] JavaScript

[0068] class InjectionPlugin{

[0069] constructor(options){

[0070]

[0071] From this, we can see that when mounting the plugin structure, parser.hooks.program.tap is used to mount the program hook (i.e. the first hook) of the parser of the JavaScript module (automatically identified). This hook is called in the program of the parser, that is, in the entire AST (attributed abstract syntax tree) stage, allowing access and modification of the AST; in the normalModuleFactory hook, parser.for('javascript / auto') is used to specify the operation of the parser, and compiler.hooks.normalModuleFactory.tap is used to mount it on the normalModuleFactory hook of Webpack (i.e. the second hook). This is an early stage of Webpack's processing of modules, allowing the behavior of the module creation process to be modified.

[0072] When loading injection information and loading files, the loaded file content is obtained through parser.state.module._source.source(), and in the callback function of the parser's program hook, first check whether the currently processed loaded file is the entry file, which is achieved by comparing parser.state.module.rawRequest (original request) and parser.state.options.entry (the entry point of the Webpack configuration).

[0073] The running code for generating the code to be injected based on the injection information may be as follows:

[0074] JavaScript

[0075] parser.state.module._source._value=parser.state.module._source.source()+"\r\n"+`document.body.${funcName}=()=>(${JSON.stringify(injects)})`;

[0076] The code to be injected is used to be inserted into the end of the entry file so that when the entry file is injected, implicit injection of injection information can be achieved.

[0077] See also Figure 2 , Figure 2 This is a flow chart of packaging using webpack. Figure 2 As shown, packaging with webpack mainly includes six life cycles: initialization stage, compilation stage, construction stage, optimization stage, output stage and completion stage, among which the stages related to information injection are initialization stage and compilation stage. Specifically, the information injection method using webpack provided by this application is applied to read the configuration conditions of webpack in the initial stage, and build the plug-in structure based on the configuration conditions so that the plug-in structure can be mounted in the compilation stage. After the mounting is completed, the entry file is loaded and the code to be injected generated according to the injected self-information is inserted into the end of the entry file to complete the implicit injection of the injected information.

[0078] When needed, the injection information in the plug-in is extracted using an acquisition method that matches the preset target package, for example, the injection information under document.body is extracted by running the following code.

[0079] document.body.setAttribute("info","aaaa")

[0080] document.body.getAttribute("info")

[0081] "aaaa"

[0082] In this way, the embodiments provided by the present application can realize implicit injection of injection information, so that the specific content of the injection information is invisible unless extracted, thereby improving information security and reducing the risk of data being attacked.

[0083] Figure 3 FIG. 3 is a block diagram of an information injection device 300 using webpack, shown in an exemplary embodiment of the present application. Figure 3 As shown, the device comprises:

[0084] A construction unit 301 is used to construct a plug-in structure using webpack;

[0085] The mounting unit 302 is used to mount the plug-in structure to the webpack to form a plug-in structure to be injected;

[0086] The loading unit 303 is used to obtain the loading file and the injection information, and load the injection information and the loading file into the plug-in structure to be injected to obtain the target plug-in to be injected;

[0087] The injection unit 304 is used to inject the target plug-in to be injected into a preset target package to complete the implicit injection of the injection information.

[0088] The device applies the information injection method using webpack provided by the present application, uses webpack to build a plug-in structure through the construction unit 301, and after the mounting unit 302 mounts the plug-in structure, the loading unit 303 loads the injection information and the loading file into the plug-in structure to be injected to obtain the target plug-in to be injected, and then the injection unit 304 injects the injection information into the target package in the form of a plug-in. In this way, the injection information is finally injected into the target package through the webpack plug-in, making the webpage HTML source code and global variables invisible, improving information security and reducing the risk of being attacked.

[0089] In another exemplary embodiment, the construction unit 301 is further used to read the configuration conditions of the webpack; and to build the plug-in structure based on the configuration conditions.

[0090] In another exemplary embodiment, the configuration conditions include injection content parameters and mount function parameters; the construction unit 301 is also used to construct an injection content object module based on the injection content parameters; construct a mount function object module based on the mount function parameters; and obtain a plug-in structure based on the injection content object module and the mount function object module.

[0091] In another exemplary embodiment, the mounting unit 302 is also used to mount the plug-in structure onto the first hook of the parser of the JavaScript module in the webpack to form a first plug-in structure; and mount the first plug-in structure onto the second hook of the webpack through the parser to form a second plug-in structure as a plug-in structure to be injected.

[0092] In another exemplary embodiment, the apparatus further comprises:

[0093] A detection unit is used to detect whether the loaded file is an entry file and obtain a detection result; if the detection result indicates that the loaded file is an entry file, the loaded file is retained to be loaded into the plug-in structure to be injected; if the detection result indicates that the loaded file is not an entry file, the loaded file is re-acquired until the corresponding detection result indicates that the loaded file is an entry file.

[0094] In another exemplary embodiment, the detection unit is also used to obtain the original request information of the loaded file; compare the original request information with the entry point information pre-configured by webpack, and when the original request information is consistent with the entry point information, obtain a detection result indicating that the loaded file is an entry file; when the original request information is inconsistent with the entry point information, obtain a detection result indicating that the loaded file is not an entry file.

[0095] In another exemplary embodiment, the loading unit 303 is further configured to generate the code to be injected based on the injection information; load the file into the plug-in structure to be injected, and load the code to be injected into the end of the plug-in structure to be injected to obtain the target plug-in to be injected.

[0096] It should be noted that the information injection device using webpack provided in the above embodiment and the information injection method using webpack provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In actual applications, the information injection device using webpack provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0097] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the information injection method using webpack provided in the above-mentioned embodiments.

[0098] Figure 4The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 4 The computer system 400 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0099] like Figure 4 As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 408 to the random access memory (RAM) 403, such as executing the method in the above embodiment. In the RAM 403, various programs and data required for system operation are also stored. The CPU 401, ROM 402 and RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0100] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that a computer program read therefrom is installed into the storage section 408 as needed.

[0101] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 409, and / or installed from a removable medium 411. When the computer program is executed by a central processing unit (CPU) 401, various functions defined in the system of the present application are executed.

[0102] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0103] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0104] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0105] Another aspect of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the information injection method using webpack as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0106] Another aspect of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the information injection method using webpack provided in the above-mentioned various embodiments.

[0107] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for information injection using webpack, characterized in that: The method comprises: Use webpack to build plugin structure; Mount the plug-in structure to the webpack to form a plug-in structure to be injected; Obtain a loading file and injection information, load the injection information and the loading file into the plug-in structure to be injected, and obtain a target plug-in to be injected; The target plug-in to be injected is injected into a preset target package to complete the implicit injection of the injection information.

2. The method according to claim 1, characterized in that The plug-in structure is constructed by using webpack, including: Read the configuration conditions of webpack; A plug-in structure is constructed based on the configuration conditions.

3. The method according to claim 2, characterized in that The configuration conditions include injection content parameters and mounting function parameters; and building a plug-in structure based on the configuration conditions includes: Constructing an injection content object module based on the injection content parameters; Constructing a mount function object module based on the mount function parameters; A plug-in structure is obtained based on the injection content object module and the mounting function object module.

4. The method according to claim 1, characterized in that: The step of mounting the plug-in structure to the webpack to form a plug-in structure to be injected includes: Mounting the plug-in structure to the first hook of the parser of the JavaScript module in the webpack to form a first plug-in structure; The first plug-in structure is mounted on the second hook of the webpack through the parser to form a second plug-in structure as a plug-in structure to be injected.

5. The method according to claim 1, characterized in that After acquiring the loading file and the injection information, the method further includes: Detecting whether the loaded file is an entry file and obtaining a detection result; If the detection result indicates that the loaded file is an entry file, retaining the loaded file to be loaded into the plug-in structure to be injected; If the detection result indicates that the loading file is not an entry file, the loading file is reacquired until the corresponding detection result indicates that the loading file is an entry file.

6. The method according to claim 5, characterized in that The detecting whether the loaded file is an entry file and obtaining a detection result includes: Obtaining original request information for loading the file; Compare the original request information with the entry point information pre-configured by webpack, and when the original request information is consistent with the entry point information, obtain a detection result indicating that the loaded file is an entry file; When the original request information is inconsistent with the entry point information, a detection result is obtained indicating that the loaded file is not an entry file.

7. The method according to claim 1, characterized in that The step of loading the injection information and the loading file into the plug-in structure to be injected to obtain the target plug-in to be injected includes: Generate a code to be injected based on the injection information; The loading file is added to the plug-in structure to be injected, and the code to be injected is loaded to the end of the plug-in structure to be injected, so as to obtain the target plug-in to be injected.

8. An information injection device using webpack, characterized in that: include: Build unit, used to build plugin structure using webpack; A mounting unit, used to mount the plug-in structure to the webpack to form a plug-in structure to be injected; A loading unit, used for acquiring a loading file and injection information, loading the injection information and the loading file into the plug-in structure to be injected, and obtaining a target plug-in to be injected; The injection unit is used to inject the target plug-in to be injected into a preset target package to complete the implicit injection of the injection information.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the information injection method using webpack as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the information injection method using webpack as described in any one of claims 1-7.