Engineering packaging method, device, equipment and storage medium
By identifying project component identifiers and dependencies, and packaging only necessary components, the problem of introducing invalid components during Webpack packaging is solved, thus improving the compilation and loading efficiency of the project.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2026-03-24
AI Technical Summary
Webpack cannot distinguish common projects shared by multiple projects during the bundling process, resulting in the introduction of a large number of invalid components, excessively large resource bundles, and impact on the compilation and loading speed of the project.
In response to the project packaging request, the component identifiers related to the project are determined, and the dependencies between business components and public components are determined based on the pre-built component configuration files. The Webpack tool is then used to package the component files of public components and business components.
Package only the common and business components required by the project to avoid introducing invalid components, reduce the resource package size, and improve the project compilation and loading efficiency.
Smart Images

Figure CN115390906B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data processing technology, and in particular to an engineering packaging method, apparatus, equipment and storage medium. Background Technology
[0002] Webpack is a modern JavaScript application static module bundler that is convenient and fast. It features entry and exit points, loaders, plugins, and patterns. It can perform code splitting and modularization to extract common code and remove dead code. Its main uses include: 1. Escaping CSS and JavaScript extensions; 2. Obfuscating and compressing multiple files into fewer files, reducing code size and removing unnecessary comments; 3. Converting common Vue and React framework files into normal HTML, CSS, and JavaScript files.
[0003] In the bundling process of related technologies, Webpack automatically generates a corresponding file dependency tree based on the file directory structure according to the configuration file, and then compiles and merges all files according to the file dependency tree to output the target production package. However, Webpack bundling mainly targets all files in the same directory of a single project, and when merging multiple files, it cannot distinguish common project projects shared by multiple projects. Therefore, it leads to the introduction of a large number of invalid components, resulting in an excessively large resource package and affecting the compilation and loading speed of the project. Summary of the Invention
[0004] This application provides an engineering packaging method, apparatus, equipment, and storage medium, which aims to at least partially solve one of the technical problems in the related art.
[0005] In a first aspect, this application provides a project packaging method, comprising: in response to a project packaging request, determining a first component identifier of a component related to the project; determining a first dependency relationship between a business component and a public component corresponding to the first component identifier based on a pre-built component configuration file, wherein the component configuration file is used to record the file path dependency relationship of global components; and packaging the component files of the public component and the business component according to the first dependency relationship.
[0006] Secondly, this application provides an engineering packaging apparatus, comprising: a first determining module, configured to determine a first component identifier of a component related to the engineering in response to an engineering packaging request; a second determining module, configured to determine a first dependency relationship between a business component and a public component corresponding to the first component identifier based on a pre-built component configuration file, wherein the component configuration file is used to record the file path dependency relationship of global components; and a packaging module, configured to package the component files of the public component and the business component according to the first dependency relationship.
[0007] Thirdly, this application provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement an engineering packaging method.
[0008] Fourthly, this application provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform an engineering packaging method.
[0009] Fifthly, this application provides a computer program product, including a computer program, and a method for packaging the computer program into an execution process by a processor.
[0010] The project packaging method, apparatus, device, and storage medium provided in this application, in response to a project packaging request, determine a first component identifier of the components related to the project, and based on a pre-built component configuration file, determine the first dependency relationship between the business components and public components corresponding to the first component identifier. The component configuration file is used to record the file path dependency relationship of global components, and the component files of public components and business components are packaged according to the first dependency relationship. This allows only the public components and business components required by the project to be packaged, thus avoiding the introduction of a large number of invalid components during the packaging process, thereby reducing the resource package size of the project and improving the compilation and loading efficiency of the project. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0012] Figure 1 This is a schematic flowchart illustrating the engineering packaging method according to the first embodiment of this application;
[0013] Figure 2 This is a schematic flowchart illustrating the engineering packaging method according to the second embodiment of this application;
[0014] Figure 3a This is a schematic diagram illustrating the business component dependencies according to an embodiment of this application;
[0015] Figure 3b This is a schematic diagram illustrating the dependencies of common components according to embodiments of this application;
[0016] Figure 3c This is a schematic diagram illustrating the component configuration file relationships according to an embodiment of this application;
[0017] Figure 4 This is a schematic flowchart illustrating an engineering packaging method according to the third embodiment of this application;
[0018] Figure 5 This is a block diagram of an engineering packaging device according to this application;
[0019] Figure 6 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present application is shown.
[0020] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0021] The embodiments of this application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. Rather, the embodiments of this application include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.
[0022] It should be noted that the execution subject of the project packaging method in this embodiment can be a project packaging device, which can be implemented by software and / or hardware. The device can be configured in an electronic device, which may include, but is not limited to, a terminal, a server, etc.
[0023] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0024] Figure 1 This is a schematic flowchart illustrating the engineering packaging method according to the first embodiment of this application, as shown below. Figure 1 As shown, the method includes:
[0025] S101: In response to the project packaging request, determine the first component identifier of the components related to the project.
[0026] In this embodiment of the application, when it is necessary to package the project, a first component identifier of the component related to the project to be packaged can be determined in response to the project packaging request.
[0027] In this embodiment, a component can also be called a module. Global components can be defined. Each project can be built from one or more global components, and each component can have a corresponding component identifier, such as component name, component number, or any other possible component identifier, without any restrictions.
[0028] The component identifier of the component related to the current project to be packaged can be referred to as the first component identifier. In some embodiments, the packaging request may carry the first component identifier, or the project may be parsed to determine the first component identifier, without limitation.
[0029] In this embodiment of the application, global components can be divided into global business components and global public components.
[0030] Among them, business components can also be called personalized components, which are related to the specific business functions implemented by the project. Different projects can have different business components.
[0031] Common components, also known as framework components, can be shared by different projects.
[0032] The project to be packaged in this embodiment can be built from business components and common components. The first component identifier can be, for example, the component identifier of the business component in the project to be packaged, or it can be the component identifier of both the business component and the common component; there is no limitation on this.
[0033] S102: Based on the pre-built component configuration file, determine the first dependency relationship between the business component and the public component corresponding to the first component identifier.
[0034] In this embodiment, a component configuration file can be pre-built, which is used to record the file path dependencies (in the form of a dependency tree) of global components.
[0035] Specifically, during the process of building the component configuration file, the component identifier, dependency relationship, and component file address of each global component (including global business components and global public components) can be determined first. Further, based on the dependency relationship, the component identifier and file address of each global component are registered to the component configuration file, thereby obtaining a tree-structured file dependency tree. Different branches of the file dependency tree can represent the file path of the component.
[0036] After determining the first component identifier of the components related to the project, the embodiments of this application can further determine the business components and public components corresponding to the first component identifier based on the component configuration file, and determine the dependency relationship between the business components and public components. This dependency relationship can be called the first dependency relationship (file dependency tree). That is to say, the first dependency relationship records the file paths of the business components and public components required by the project to be packaged.
[0037] S103: Package the component files of public components and business components according to the first dependency relationship.
[0038] After determining the first dependency relationship, this embodiment can further package the component files of the public components and business components required by the project according to the first dependency relationship.
[0039] In some implementations, for example, the Webpack tool can be used to bundle the component files of public and business components. That is, the Webpack tool is called to compile the code files of business and public components in the project to be bundled, and the resource package of the project is obtained.
[0040] In some implementations, based on the first dependency, the Webpack tool is used to bundle the component files of common components and business components, including the following steps:
[0041] a1. Based on the first dependency relationship, register the file paths of the public components and business components to generate a route file (Vue file). That is to say, the first dependency relationship is represented in the form of a route, and the route file can record the file paths of the component files of the public components and business components.
[0042] a2. Further, obtain the component files (i.e., code files) of public components and business components according to the file paths in the routing file, and bundle them, that is: use the Webpack tool to bundle the obtained component files.
[0043] In this embodiment, in response to a project packaging request, a first component identifier related to the project is determined. Based on a pre-built component configuration file, the first dependency relationship between the business component and the public component corresponding to the first component identifier is determined. The component configuration file is used to record the file path dependency relationship of global components. According to the first dependency relationship, the Webpack tool is used to package the component files of the public component and the business component. This allows only the public component and business component required by the project to be packaged. Therefore, a large number of invalid components will not be introduced during the packaging process, thereby reducing the resource package size of the project and improving the compilation and loading efficiency of the project.
[0044] Figure 2This is a flowchart illustrating the engineering packaging method according to the second embodiment of this application, as shown below. Figure 2 As shown, the method includes:
[0045] S201: In response to a project packaging request, determine the first component identifier of the components related to the project.
[0046] For a detailed explanation of S201, please refer to the above embodiments, which will not be repeated here.
[0047] S202: Based on the pre-built business component configuration file, determine the second dependency relationship of the business component corresponding to the first component identifier.
[0048] In this embodiment of the application, the component configuration file may include a business component configuration file and a public component configuration file.
[0049] The business component configuration file is used to record the dependencies of global business components. Figure 3a This is a schematic diagram illustrating the business component dependency relationships according to embodiments of this application, such as... Figure 3a As shown, global business components include, for example, business component 1, business component 2, ... business component N, where business component 2 depends on business component 1, business component 3 depends on business component 2, and so on. Similarly, the public component configuration file is used to record the dependencies of global public components. Figure 3b This is a schematic diagram illustrating the dependencies of common components according to embodiments of this application, such as... Figure 2 As shown, global common components include common component 1, common component 2, common component 3, ..., common component N, where common component 2 depends on common component 1.
[0050] Some embodiments, Figure 3c This is a schematic diagram illustrating the component configuration file relationship according to an embodiment of this application, such as... Figure 3c As shown, the business component configuration file and the public component configuration file can be configured with a unified project entry point, through which the business component configuration file and the public component configuration file can be accessed.
[0051] In this embodiment, the first component identifier can be, for example, the component identifier of a business component in the project to be packaged. In the operation of determining the first dependency relationship between the business component and the public component corresponding to the first component identifier based on the pre-built component configuration file, this embodiment can determine the dependency relationship (dependency tree) of the business component corresponding to the first component identifier based on the pre-built business component configuration file. This dependency relationship can be called the second dependency relationship. That is to say, the second dependency relationship can characterize the dependency relationship of the business components in the project to be packaged.
[0052] S203: Determine the third dependency of a public component based on the pre-built public component configuration file and the second dependency.
[0053] After determining the second dependency of the business components as described above, this implementation can further determine the third dependency of the public components based on the pre-built public component configuration file and the second dependency. That is to say, the third dependency can characterize the dependency of the public components in the project to be packaged.
[0054] In some embodiments, determining third dependencies of public components includes the following steps:
[0055] b1. Determine the second component identifier of the common component that the business component depends on based on the second dependency relationship. Specifically, in this embodiment, for each business component in the second dependency relationship, determine the component identifier of the common component that it depends on, which can be referred to as the second component identifier.
[0056] b2. Further, the second component identifier is scanned based on the public component configuration file to determine the third dependency. For example, scanning the second component identifier (e.g., component name) in the public component configuration file yields a set of public components. A file dependency tree, i.e., the third dependency, is then generated based on the dependencies within this set. Therefore, this embodiment addresses the file dependency issue by using code scanning, without relying on the developer's own actions, making it less likely to miss components and ensuring the completeness of component dependencies while maintaining component simplicity.
[0057] S204: Determine the first dependency based on the second and third dependencies.
[0058] In other words, the first dependency is obtained by combining the second dependency of the business component and the third dependency of the public component.
[0059] In some embodiments, when a new business component is developed, the dependencies of the new business component (including component identifier, component file address, etc.) can be registered to the business component configuration file; similarly, when a new public component is developed, the dependencies of the new public component can be registered to the public component configuration file.
[0060] Therefore, the common components and business components in this embodiment can be developed independently without interfering with each other, while still having interdependencies. During the project development process, the common components and business components can be freely combined to quickly and reproducibly generate new projects, addressing the needs of multifunctional shared components, enabling rapid onboarding, reducing redundant development, and achieving more stable code quality.
[0061] S205: Package the component files of public components and business components according to the first dependency relationship.
[0062] For a detailed description of S205, please refer to the above embodiments, which will not be repeated here.
[0063] In this embodiment, the first component identifier can be, for example, the component identifier of a business component in the project to be packaged. In the operation of determining the first dependency relationship between the business component and the public component corresponding to the first component identifier based on a pre-built component configuration file, this embodiment can determine the dependency relationship (dependency tree) of the business component corresponding to the first component identifier based on a pre-built business component configuration file. This dependency relationship can be called the second dependency relationship; that is, the second dependency relationship can characterize the dependency relationship of the business components in the project to be packaged. Furthermore, in this embodiment, the public component and the business component can be developed independently without interference, and they have dependencies on each other. During project development, the public component and the business component can be freely combined to quickly and reproducibly generate new projects, addressing the needs of multifunctional shared components, enabling rapid onboarding, reducing redundant development, and achieving more stable code quality.
[0064] Figure 4 This is a flowchart illustrating the engineering packaging method according to the third embodiment of this application, as shown below. Figure 4 As shown, the method includes:
[0065] S301: In response to a project packaging request, determine the first component identifier of the components related to the project.
[0066] S302: Based on the pre-built component configuration file, determine the first dependency relationship between the business component and the public component corresponding to the first component identifier, wherein the component configuration file is used to record the file path dependency relationship of the global component.
[0067] For detailed descriptions of S301-S302, please refer to the above embodiments, which will not be repeated here.
[0068] S303: Get the component file of the global component.
[0069] In the process of packaging the component files of public components and business components using the Webpack tool according to the first dependency relationship in this embodiment of the application, the component files of global components (i.e., component code files) are first obtained, including the component files of global business components and the component files of global public components.
[0070] S304: Identify redundant components in the global components based on the first dependency relationship, and delete the component files of the redundant components.
[0071] Among them, components that do not appear in the first dependency relationship can be called redundant components, including business redundant components and public redundant components. That is to say, if the redundant components are not related to the project, the component files of the redundant components can be deleted in this embodiment, and only the public components and business components related to the project in the global components can be retained.
[0072] S305: Package the component files of the remaining public components and business components.
[0073] Furthermore, the Webpack tool is used to bundle the component files of the remaining common and business components after removing redundant components.
[0074] Therefore, this embodiment can eliminate redundant components based on global components, ensuring the integrity of project components and optimizing the amount of code and loading speed of the project.
[0075] In this embodiment, the first component identifier can be, for example, the component identifier of a business component in the project to be packaged. In the operation of determining the first dependency relationship between the business component and the public component corresponding to the first component identifier based on a pre-built component configuration file, this embodiment can determine the dependency relationship (dependency tree) of the business component corresponding to the first component identifier based on a pre-built business component configuration file. This dependency relationship can be called the second dependency relationship; that is, the second dependency relationship can characterize the dependency relationship of the business components in the project to be packaged. Furthermore, this embodiment can eliminate redundant components based on global components, ensuring the integrity of project components and optimizing the project's code size and loading speed.
[0076] Figure 5 This is a block diagram of an engineering packaging device shown in this application, such as... Figure 5 As shown, the engineering packaging device 50 includes:
[0077] The first determining module 501 is used to determine the first component identifier of the components related to the project in response to the project packaging request;
[0078] The second determining module 502 is used to determine the first dependency relationship between the business component and the public component corresponding to the first component identifier based on the pre-built component configuration file, wherein the component configuration file is used to record the file path dependency relationship of the global component;
[0079] The packaging module 503 is used to package the component files of common components and business components using the Webpack tool based on the first dependency.
[0080] In some embodiments, the second determining module 502 includes:
[0081] The first determination submodule is used to determine the second dependency relationship of the business component corresponding to the first component identifier based on the pre-built business component configuration file;
[0082] The second determination submodule is used to determine the third dependency of a public component based on a pre-built public component configuration file and the second dependency; and
[0083] The third determination submodule is used to determine the first dependency based on the second and third dependencies.
[0084] In some embodiments, the second determining submodule is specifically used for:
[0085] The second component identifier of the public component that the business component depends on is determined based on the second dependency relationship; and
[0086] The second component identifier is scanned based on the public component configuration file to determine the third dependency.
[0087] In some embodiments, device 50 further includes:
[0088] The first newly added module is used to register the dependencies of the new business component to the business component configuration file after the new business component development is completed; and / or
[0089] The second new module is used to register the dependencies of the new public component to the public component configuration file after the development of the new public component is completed.
[0090] In some embodiments, the packaging module 503 is specifically used for:
[0091] Get the component file of the global component;
[0092] Based on the first dependency relationship, identify redundant components in the global components and delete the component files of the redundant components; and
[0093] The Webpack tool is used to bundle the component files of the remaining common components and business components.
[0094] In some embodiments, the packaging module 503 is specifically used for:
[0095] A route file is generated based on the first dependency relationship. This route file records the file paths of the component files for common components and business components; and
[0096] Obtain the component files of public and business components from the routing file, and then bundle them using the Webpack tool.
[0097] This embodiment, in response to a project packaging request, determines the first component identifier of the components related to the project, and based on a pre-built component configuration file, determines the first dependency relationship between the business components and public components corresponding to the first component identifier. The component configuration file is used to record the file path dependency relationship of global components. According to the first dependency relationship, the Webpack tool is used to package the component files of public components and business components. This allows only the public components and business components required by the project to be packaged, so that a large number of invalid components are not introduced during the packaging process, thereby reducing the resource package size of the project and improving the project compilation and loading efficiency.
[0098] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.
[0099] Figure 6 This is a block diagram illustrating an electronic device according to this application. For example, electronic device 600 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0100] Reference Figure 6 The electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0101] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0102] Memory 604 is configured to store various types of data to support the operation of electronic device 600. Examples of this data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0103] Power supply component 606 provides power to various components of electronic device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.
[0104] Multimedia component 608 includes a touch display screen that provides an output interface between electronic device 600 and user. In some embodiments, the touch display screen may include a liquid crystal display (LCD) and a touch panel (TP). The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When electronic device 600 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0105] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616.
[0106] In some embodiments, the audio component 610 further includes a speaker for outputting audio signals.
[0107] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0108] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 may detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0109] Communication component 616 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0110] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described engineering packaging method.
[0111] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 920 of an electronic device 600 to perform the above-described method. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0112] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0113] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for packaging engineering projects, characterized in that, include: In response to a project packaging request, a first component identifier of the components related to the project is determined; Based on a pre-built component configuration file, determining a first dependency relationship between a business component and a public component corresponding to the first component identifier includes: determining a second dependency relationship between a business component and a public component based on a pre-built business component configuration file; determining a second component identifier of a public component that the business component depends on based on the second dependency relationship; scanning the second component identifier based on the public component configuration file to determine a third dependency relationship; and determining the first dependency relationship based on the second dependency relationship and the third dependency relationship, wherein the component configuration file is used to record file path dependencies of global components; Based on the first dependency relationship, the component files of the public component and the business component are packaged.
2. The method according to claim 1, characterized in that, The method further includes: Once the development of a new business component is complete, the dependencies of the new business component are registered to the business component configuration file; and / or Once the development of a new public component is complete, the dependencies of the new public component are registered in the public component configuration file.
3. The method according to claim 1, characterized in that, The step of packaging the component files of the public component and the business component according to the first dependency relationship includes: Obtain the component file of the global component; Based on the first dependency relationship, redundant components in the global components are identified, and the component files of the redundant components are deleted; and Package the component files of the remaining public components and business components.
4. The method according to claim 1, characterized in that, The step of packaging the component files of the public component and the business component according to the first dependency relationship includes: A routing file is generated based on the first dependency relationship, wherein the routing file is used to record the file paths of the component files of the common component and the business component; and The component files of the public components and business components are obtained from the routing file and packaged.
5. The method according to any one of claims 1-4, characterized in that, The packaging of the component files for the public components and business components includes: The Webpack tool is used to bundle the component files of the public and business components.
6. An engineering packaging device, characterized in that, include: The first determining module is used to determine a first component identifier of a component related to the project in response to a project packaging request; The second determining module is used to determine the first dependency relationship between the business component and the public component corresponding to the first component identifier based on the pre-built component configuration file, wherein the component configuration file is used to record the file path dependency relationship of the global component; The second determining module includes: The first determining submodule is used to determine the second dependency relationship of the business component corresponding to the first component identifier based on a pre-built business component configuration file; The second determining submodule is used to determine the third dependency of the public component based on the pre-built public component configuration file and the second dependency relationship. Specifically, it is used to: determine the second component identifier of the public component that the business component depends on based on the second dependency relationship; and scan the second component identifier based on the public component configuration file to determine the third dependency relationship; and The third determining submodule is used to determine the first dependency based on the second dependency and the third dependency; The packaging module is used to package the component files of the public component and the business component according to the first dependency relationship.
7. The apparatus according to claim 6, characterized in that, The device further includes: The first newly added module is used to register the dependencies of the newly added business component to the business component configuration file after the development of the new business component is completed; and / or The second newly added module is used to register the dependencies of the newly added public component to the public component configuration file after the development of the new public component is completed.
8. The apparatus according to claim 6, characterized in that, The packaging module is specifically used for: Obtain the component file of the global component; Based on the first dependency relationship, redundant components in the global components are identified, and the component files of the redundant components are deleted; and Package the component files of the remaining public components and business components.
9. The apparatus according to claim 6, characterized in that, The packaging module is specifically used for: A routing file is generated based on the first dependency relationship, wherein the routing file is used to record the file paths of the component files of the common component and the business component; and The component files of the public components and business components are obtained from the routing file and packaged.
10. The apparatus according to any one of claims 6-9, characterized in that, The packaging module is specifically used for: The Webpack tool is used to bundle the component files of the public and business components.
11. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-5.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-5.
13. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-5.
Citation Information
Patent Citations
Webpack packaging system and method, corresponding equipment and storage medium
CN112732328A
Single file component development method and device and electronic equipment
CN112835562A