Customized file compiling method and device, electronic equipment and storage medium

Through the customized file compilation method, the complexity of customized code and baseline code management in business system development is solved, and fast and accurate dynamic packaging and compilation is achieved, which reduces branch management costs and improves the maintainability and organization of the code.

CN118939271APending Publication Date: 2024-11-12CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411006772.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In business system development, it is difficult for the existing technology to effectively manage customized code and baseline code, resulting in duplication of code and confusing version management, and cumbersome branch management.

Method used

Provide a custom file compilation method. By creating a custom code module directory, obtaining the target configuration file and storing it in the preset baseline directory, using the target plug-in in the front-end project configuration file to read and package the target configuration file, and according to the configuration packaging command The target configuration file is deployed with the customized code module directory, which can replace or integrate the customized version and the baseline version, and quickly and accurately perform dynamic packaging and compilation of front-end configurable.

Benefits of technology

It realizes personalized user customization, reduces branch management costs, simplifies unified development management, and improves the maintainability and organization of code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939271A_ABST
    Figure CN118939271A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a customized file compiling method and device, electronic equipment and a storage medium, is applied to the technical field of system development, and can solve the problem of how to select a specific customized code development mode and a customized code branch management method. The method comprises the following steps: creating a customized code module directory; obtaining a target configuration file, and storing the target configuration file in a preset baseline directory, the target configuration file being generated according to the version customization information of the user; reading and packaging a target configuration file through a target plug-in in the front-end project configuration file; and deploying the target configuration file and the customized code module directory according to the configuration packaging command to obtain a target customized file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of system development technology, and in particular to a customized file compilation method, device, electronic device and storage medium. Background Art

[0002] In business system development, we often encounter the development of customized requirements, which requires customized development without destroying the baseline version of the code. The existing solution is to use Git / Svn for version management, and each version is managed under each branch without affecting each other. In the back-end development, the OneTrack mode is selected, that is, all customized codes and baseline codes are placed in a warehouse and directory, and the customized version chooses a new module, and each customization does not affect each other. The same management method can also be used for customized deployment in front-end customized development, and the baseline and customized modules can be deployed in combination at will. However, the above method has a lot of code duplication, and there will be confusion in version management. It is necessary to switch branches for packaging, which is a cumbersome situation. Therefore, how to choose a specific custom code development method and custom code branch management method is an urgent problem to be solved. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present application provide a customized file compilation method, device, electronic device and storage medium to solve the current problem of how to select a specific customized code development method and a customized code branch management method.

[0004] In order to achieve the above purpose, the technical solutions provided by the embodiments of the present application are as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for compiling a customized file, the method comprising: creating a customized code module directory;

[0006] Obtaining a target configuration file and storing it in a preset baseline directory, wherein the target configuration file is generated according to the version customization information of the user;

[0007] Read and package the target configuration file through the target plug-in in the front-end project configuration file;

[0008] According to the configuration packaging command, the target configuration file and the customized code module directory are deployed to obtain the target customized file.

[0009] As an optional implementation manner, in the first aspect of the embodiment of the present application, obtaining the target configuration file includes:

[0010] In response to an input operation of a user, obtaining version customization information of the user;

[0011] The target configuration file is generated according to the version customization information and the preset template.

[0012] As an optional implementation, in the first aspect of the embodiment of the present application, the target configuration file and the customized code module directory are deployed to obtain a target customized file, including:

[0013] Obtain a target dependency file, wherein the target dependency file includes at least: development dependency information, production dependency information, and the configuration packaging command;

[0014] Determine, according to the configuration packaging command, a custom directory file in the custom code module directory corresponding to the development dependency information and the production dependency information;

[0015] The target configuration file and the customized catalog file are deployed to obtain a target customized file.

[0016] As an optional implementation, in the first aspect of the embodiment of the present application, before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, the method further includes:

[0017] Create a plugin directory;

[0018] Read the custom code module directory through the target module in the plug-in directory to obtain file path information;

[0019] The target configuration file is read and packaged through the target plug-in in the front-end project configuration file, including:

[0020] The target configuration file is read and packaged according to the file path information through the target plug-in in the front-end project configuration file.

[0021] As an optional implementation, in the first aspect of the embodiment of the present application, before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, the method further includes:

[0022] Generate code syntax in the plugin directory;

[0023] The version customization information of the user is received through the constructor in the code syntax.

[0024] As an optional implementation, in the first aspect of the embodiment of the present application, before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, the method further includes:

[0025] Create a target method in the plugin directory;

[0026] Obtain information parameters through the target method, wherein the information parameters include file information corresponding to the target plug-in;

[0027] The target configuration file is read and packaged through the target plug-in in the front-end project configuration file, including:

[0028] According to the target plug-in in the front-end project configuration file, the target configuration file is read, and file information corresponding to the target plug-in is replaced by the target configuration file.

[0029] In a second aspect, an embodiment of the present application provides a customized file compiling device, the customized file compiling device comprising: a creation module, used to create a customized code module directory;

[0030] An acquisition module is used to acquire a target configuration file and store it in a preset baseline directory, wherein the target configuration file is generated according to the version customization information of the user;

[0031] A processing module, used for reading and packaging the target configuration file through the target plug-in in the front-end project configuration file;

[0032] The processing module is further used to deploy the target configuration file and the customized code module directory according to the configuration packaging command to obtain the target customized file.

[0033] As an optional implementation, in the second aspect of the embodiment of the present application, the acquisition module is specifically used to obtain the version customization information of the user in response to the user's input operation;

[0034] The processing module is specifically used to generate the target configuration file according to the version customization information and the preset template.

[0035] As an optional implementation, in the second aspect of the embodiment of the present application, the acquisition module is specifically used to acquire a target dependency file, wherein the target dependency file at least includes: development dependency information, production dependency information, and the configuration packaging command;

[0036] The processing module is specifically used to determine, in accordance with the configuration packaging command, a custom directory file in the custom code module directory corresponding to the development dependency information and the production dependency information;

[0037] The processing module is specifically used to deploy the target configuration file and the customized directory file to obtain a target customized file.

[0038] As an optional implementation, in the second aspect of the embodiment of the present application, the creation module is further used to create a plug-in directory;

[0039] The processing module is further used to read the custom code module directory through the target module in the plug-in directory to obtain file path information;

[0040] The processing module is further used to read and package the target configuration file according to the file path information through the target plug-in in the front-end project configuration file.

[0041] As an optional implementation, in the second aspect of the embodiment of the present application, the creation module is further used to generate code syntax in the plug-in directory;

[0042] The processing module is further used to receive the version customization information of the user through the constructor in the code syntax.

[0043] As an optional implementation, in the second aspect of the embodiment of the present application, the creation module is further used to create a target method in the plug-in directory;

[0044] The acquisition module is further used to acquire information parameters through the target method, wherein the information parameters include file information corresponding to the target plug-in;

[0045] The processing module is further configured to read the target configuration file according to the target plug-in in the front-end project configuration file, and replace the file information corresponding to the target plug-in with the target configuration file.

[0046] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0047] A memory storing executable program code;

[0048] a processor coupled to the memory;

[0049] The processor calls the executable program code stored in the memory to execute the customized file compilation method in the first aspect of the embodiment of the present application.

[0050] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the customized file compilation method in the first aspect of the embodiment of the present application. The computer-readable storage medium includes a ROM / RAM, a magnetic disk or an optical disk, etc.

[0051] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute part or all of the steps of any one of the methods of the first aspect.

[0052] In a sixth aspect, an embodiment of the present application provides an application publishing platform, which is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes part or all of the steps of any one method of the first aspect.

[0053] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0054] The embodiment of the present application provides a customized file compilation method, device, electronic device and storage medium, which creates a customized code module directory; obtains a target configuration file and stores it in a preset baseline directory, where the target configuration file is generated based on the user's version customization information; reads and packages the target configuration file through a target plug-in in a front-end project configuration file; deploys the target configuration file and the customized code module directory according to the configuration packaging command to obtain a target customized file. In this solution, the target plug-in can be used to implement user customization of the version, and the target plug-in can be used to replace or merge the customized version and the baseline version, quickly and accurately perform front-end configurable dynamic packaging compilation, facilitate unified development management, and reduce branch management costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0057] Figure 1 This is a schematic diagram of a custom file compilation method provided in an embodiment of the present application. Figure 1 ;

[0058] Figure 2 This is a schematic diagram of a custom file compilation method provided in an embodiment of the present application. Figure 2 ;

[0059] Figure 3 It is a structural diagram of a customized file compilation device provided in an embodiment of the present application;

[0060] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0062] The terms “first”, “second” and the like in the description and claims of the present application are used to distinguish different objects rather than to describe a specific order of the objects.

[0063] The terms "including" and "having" and any variations thereof in the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.

[0064] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0065] In business system development, we often encounter the development of customized requirements. Custom development needs to be carried out on the basis of the code without destroying the baseline version. How to choose the specific code development method and code branch management method is what we need to consider. The existing solution is to use Git / Svn for version management, and each version is managed under each branch without affecting each other. In back-end development, the OneTrack mode will be selected, that is, all customized codes and baseline codes are placed in a warehouse and directory, and the customized version chooses a new module, and each customization does not affect each other. The same management method can also be used for customized deployment in front-end customized development, and the baseline and customized modules can be deployed in combination at will. The current method of using Git / Svn branch management and packaging has the following shortcomings: a lot of code duplication; and the version management is chaotic, and it is necessary to switch branches for packaging, which is cumbersome.

[0066] In order to solve some or all of the above technical problems, the embodiments of the present application provide a customized file compilation method, device, electronic device and storage medium, create a customized code module directory; obtain a target configuration file and store it in a preset baseline directory, the target configuration file is generated according to the user's version customization information; read and package the target configuration file through the target plug-in in the front-end project configuration file; deploy the target configuration file and the customized code module directory according to the configuration packaging command to obtain the target customized file. In this solution, the user can realize personalized customization of the version through the target plug-in, and the replacement or fusion of the customized version and the baseline version can be realized through the target plug-in, and the dynamic packaging compilation of the front-end configurable can be performed quickly and accurately, which is convenient for unified development management and reduces branch management costs.

[0067] like Figure 1 As shown, Figure 1 A flowchart of a customized file compilation method provided in an embodiment of the present application, the method may include the following steps:

[0068] 101. Create a custom code module directory.

[0069] In an embodiment of the present application, the customized code module directory may be a customized directory customized according to the customization requirements of the user, and may be merged or replaced with files in the baseline directory to obtain a new version directory.

[0070] In some embodiments, customizing the code module directory is an important part of the software development process, which helps improve the maintainability, reusability, and organization of the code.

[0071] 102. Obtain the target configuration file and store it in a preset baseline directory.

[0072] In an embodiment of the present application, the target configuration file is generated according to the user's version customization information, that is, a corresponding configuration file can be generated according to the user's customized information, so as to realize personalized customization of the system version. After the target configuration file is generated according to the user's version customization information, the target configuration file can be stored in a preset baseline directory.

[0073] In some embodiments, the preset baseline directory may be a build directory under a root directory, and customized version information configuration may be performed in the build directory under the root directory.

[0074] In some embodiments, a baseline directory is distinguished from a customized directory. A customized directory generally refers to a customized setting of the directory structure in a document or project according to specific requirements or specifications, including but not limited to the directory hierarchy, naming rules, and the types of content included. The purpose of a customized directory is to make the structure of a document or project clearer and more orderly, and to facilitate management and maintenance.

[0075] The baseline directory is more common in software development and version control. It refers to the directory that stores stable versions or important milestone versions of the project. The baseline directory is usually used for archiving and publishing to ensure that the project team can easily access and reference these stable versions. In version control systems such as SVN (Subversion), the baseline directory is usually implemented through the "tags" directory. For example, in an SVN project, there may be a directory called "tags", which contains multiple subdirectories, each of which corresponds to a specific baseline version (such as "v1.0", "v1.1", etc.), and these subdirectories contain all the source code and other related files of the baseline version.

[0076] In some embodiments, it is necessary to establish clear naming conventions for the baseline directory and its subdirectories for easy identification and management. For example, the version number can be used as the name of the subdirectory; and it is necessary to determine what content needs to be stored in the baseline directory, which may include build scripts, documents, test reports, etc. in addition to source code; and appropriate access permissions can be set for the baseline directory as needed to ensure that only authorized personnel can access and modify these stable versions; and the functions of the version control system can be used to manage the change history of the baseline directory for easy tracking and backtracking.

[0077] 103. Read and package the target configuration file through the target plug-in in the front-end project configuration file.

[0078] In an embodiment of the present application, the front-end project configuration file may be a vue.config.js file, and the target plug-in may be a FrontOneTrackWebpackPlugin plug-in.

[0079] In some embodiments, vue.config.js is an optional configuration file that allows you to override the default configuration of vue.cli.service.js in the project. By editing this file, you can customize the project in various ways, such as defining environment variables, configuring proxies, adjusting webpack configuration, etc. In addition, you need to ensure that the vue.config.js file is placed in the root directory of the project (at the same level as package.json).

[0080] In some embodiments, the target plug-in is used to read and package the customized information.

[0081] In some embodiments, Webpack is a static module packaging tool (module bundler) for modern JavaScript applications, which is mainly used to package the code and resources of front-end applications into static resource files for loading in browsers. When webpack processes an application, it can internally build a dependency graph from one or more entry points, and then combine each module required in your project into one or more bundles, all of which are static resources for displaying your content.

[0082] Webpack can package the modules in the application and merge them into one or more static resource files. In Webpack, all files are modules. The loader converts the files, the plugin injects hooks, and finally outputs files composed of multiple modules. Webpack focuses on building modular projects and can be regarded as a module bundler. It analyzes the project structure, finds JavaScript modules and other extended languages ​​that browsers cannot run directly (such as Scss, TypeScript, etc.), and packages them into a suitable format for browser use.

[0083] Webpack can perform module packaging: package multiple modules (files) in the project into one or more bundle files for easy browser loading; code conversion: supports converting code written in other languages ​​or frameworks (such as TypeScript, CoffeeScript, ES6 / ES7, etc.) into JavaScript code that can be recognized by the browser; resource optimization: compress, obfuscate, remove duplicates and other optimization operations on the code to improve the loading speed and performance of the application; file segmentation: supports segmenting the code in the application into multiple files to achieve on-demand loading and reduce the initial loading time; automatic refresh: monitor file changes and automatically rebuild the application when the file changes so that developers can see the effect of the modification instantly; development server: provides a development server that can quickly start a web service locally for debugging and testing applications; plug-in system: has a rich plug-in system, and its functions can be extended through plug-ins, such as automatically generating HTML files, extracting CSS styles, optimizing pictures, etc.; module hot replacement (HMR): supports hot replacement function, which can replace, add or delete modules without refreshing the page when the application is running.

[0084] Webpack is widely used in the development and construction process of front-end projects. Especially in complex front-end projects, Webpack can significantly improve development efficiency and project performance. It supports a variety of front-end frameworks and libraries, such as React, Vue, Angular, etc., and can be used in conjunction with other tools (such as Babel, ESLint, etc.) to form a complete front-end development process.

[0085] In some embodiments, before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, it can also include: creating a plug-in directory; reading the custom code module directory through the target module in the plug-in directory to obtain file path information; on this basis, reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, which can specifically include: reading and packaging the target configuration file according to the file path information through the target plug-in in the front-end project configuration file.

[0086] It should be noted that you can create a new index.js in the plugin directory to write a Webpack plugin, that is, define the plugin directory, and then introduce the Node path module in index.js to read the directory where the custom code is located, and obtain the path information of the files associated with the custom requirements, so as to facilitate the corresponding operations during packaging and compilation. The target module is the path module. After obtaining the file path information through the path module, the target plugin in the front-end project configuration file can read and package the target configuration file according to the file path information, that is, the target plugin can query the storage of the target configuration file according to the file path information, and read and package the target configuration file.

[0087] In some embodiments, before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, it can also include: generating code syntax in the plug-in directory; receiving the user's version customization information through the constructor in the code syntax.

[0088] It should be noted that the code syntax is the Class class, and the constructor is the Construtor. That is to say, in the index.js file, by defining a Class class, its Construtor constructor is used to receive the customized version information passed in by the user. The information contains the name of the customized requirement and the name of the file to be replaced.

[0089] It should be noted that the Class class is a core concept in programming, especially in object-oriented programming (OOP). Class is the basis for object-oriented programming (OOP) to implement information encapsulation. It is a user-defined reference data type, also known as a class type. It contains data descriptions and a set of functions that operate data or pass messages. The Class class itself is also a type of class. In languages ​​such as Java, objects of the Class class are used to represent classes and interfaces in the currently running Java application. Objects of the Class class encapsulate information about the class itself, such as the class's member variables, member methods, implemented interfaces, and parent classes.

[0090] The Class class improves internal high cohesion and low coupling with the outside by encapsulating data and operations into an organic whole. Encapsulation ensures that the member variables and methods of the class are not directly accessed by the outside, but interact through specific interfaces, thereby enhancing security and simplifying programming. In object-oriented programming, the Class class supports inheritance features. Subclasses can inherit the properties and methods of the parent class, and can also add their own properties and methods or override the methods of the parent class. Inheritance makes the code more modular and improves the reusability of the code. Polymorphism means that the same operation can have different interpretations and execution results when acting on different objects. At runtime, the methods in the subclass (derived class) can be called through a pointer or reference to the parent class (base class).

[0091] In some embodiments, before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, it may also include: creating a target method in the plug-in directory; obtaining information parameters through the target method, the information parameters including file information corresponding to the target plug-in; on this basis, reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, which may specifically include: reading the target configuration file according to the target plug-in in the front-end project configuration file, and replacing the file information corresponding to the target plug-in through the target configuration file.

[0092] It should be noted that the target method can be the apply method corresponding to the Webpack plug-in. When the normal Webpack plug-in is running, Webpack will read the apply method in the plug-in, so it is necessary to define the apply method in the plug-in. This method can receive information parameters, which include file information passed in by the Webpack plug-in during the packaging process. The file information passed in by the Webpack plug-in here is replaced according to the configured file information to achieve customized packaging requirements.

[0093] In Webpack, the plugin system allows developers to extend the functionality of Webpack to meet more complex build requirements. Each Webpack plugin is a JavaScript object with an apply method, which is called by the Webpack compiler instance, through which the plugin can access the main function of Webpack. The apply method usually receives a compiler parameter (that is, an information parameter), which represents the complete life cycle of Webpack and provides multiple hooks, through which plugins can inject their own code logic at different times.

[0094] In some embodiments, the use of the packaging plug-in is to install the plug-in using npm, create a new build.config.js in the root directory of the project, configure the packaging information of each customized requirement in it, and then introduce the plug-in in Vue.config.js and add it in the plugins property for use.

[0095] Among them, npm (Node Package Manager) is a front-end package management tool installed with Node.js, which is used for publishing, installing, uninstalling, managing dependencies, etc. of node.js packages. It allows you to share and use code written by other JavaScript developers, and also allows JavaScript developers to reuse code and save development time.

[0096] With npm, it is easy to install Node.js libraries, which often contain code that can be reused in your application. npm can automatically handle dependencies, that is, other libraries that your project depends on. When installing a library, npm will check whether this library requires other libraries (called dependencies) and automatically install them. Developers can publish their own packages to npm's public repository for other developers to use. npm allows you to specify a specific version of the installation package, which helps ensure the stability and predictability of the project. npm supports defining scripts in the project's package.json file and allows you to run these scripts with simple commands.

[0097] 104. According to the configuration packaging command, the target configuration file and the customized code module directory are deployed to obtain the target customized file.

[0098] In an embodiment of the present application, the configuration packaging command can be user-defined or determined according to version customization information. The target configuration file and the customized code module directory can be deployed according to the configuration packaging command, that is, the target configuration file and the customized code module directory can be merged, replaced or deleted to obtain the final target customized file.

[0099] The embodiment of the present application provides a customized file compilation method, which creates a customized code module directory; obtains a target configuration file and stores it in a preset baseline directory, where the target configuration file is generated based on the user's version customization information; reads and packages the target configuration file through a target plug-in in a front-end project configuration file; deploys the target configuration file and the customized code module directory according to the configuration packaging command to obtain a target customized file. In this solution, the target plug-in can be used to implement user customization of the version, and the target plug-in can be used to replace or merge the customized version and the baseline version, quickly and accurately perform front-end configurable dynamic packaging compilation, facilitate unified development management, and reduce branch management costs.

[0100] like Figure 2 As shown, Figure 2 A flowchart of a customized file compilation method provided in an embodiment of the present application, the method may also include the following steps:

[0101] 201. Create a custom code module directory.

[0102] In the embodiment of the present application, for the description of step 201, please refer to the detailed description of step 101 in the above embodiment, and the embodiment of the present application will not be repeated.

[0103] 202. In response to an input operation of the user, obtain version customization information of the user.

[0104] In an embodiment of the present application, a user may customize the configuration information of a customized version and input it, so that the user's version customization information may be determined based on the content input by the user.

[0105] 203. Generate a target configuration file according to the version customization information and the preset template.

[0106] In the embodiment of the present application, a preset template with a version may be pre-stored, so that after obtaining the version customization information of the user, the version customization information may be integrated into the preset template to obtain a target configuration file.

[0107] 204. Store the target configuration file in a preset baseline directory.

[0108] 205. Read and package the target configuration file through the target plug-in in the front-end project configuration file.

[0109] In the embodiment of the present application, for the description of steps 204 to 205, please refer to the detailed description of steps 102 to 103 in the above embodiment, which will not be repeated in the embodiment of the present application.

[0110] 206. Get target dependency files.

[0111] In an embodiment of the present application, the target dependency file may include at least: development dependency information, production dependency information, and configuration packaging commands, etc. The target dependency file may be a package.json file.

[0112] In some embodiments, the package.json file is a very important file in the Node.js project, which is located in the root directory of the project. This file contains the project's metadata, such as the project name, version, and a list of dependent third-party libraries. The existence of the package.json file makes it easier to manage and share Node.js projects.

[0113] If you don't have a package.json file yet, you can create one by running the npminit command, which will guide you through a series of questions to generate a basic package.json file. You can also use the -y or --yes parameter to skip these questions and quickly generate the file using default values.

[0114] The package.json file is the core of Node.js project management and maintenance. It not only ensures that the project's dependencies are clear and easy to share and collaborate with team members, but also makes it easy to install, update, and uninstall project dependencies through package managers such as npm or yarn. The package.json file is an indispensable part of the Node.js project. It contains important information such as the project's metadata, dependency information, and script commands. Understanding and correctly using this file is essential for effectively managing and maintaining Node.js projects.

[0115] 207. According to the configuration packaging command, determine the custom directory file corresponding to the development dependency information and the production dependency information in the custom code module directory.

[0116] In an embodiment of the present application, the configuration packaging command may include a packaging method and a specific packaging file. That is to say, according to the configuration packaging command, it can be determined which files need to be packaged and how to package them. Therefore, the custom directory file can be determined first according to the configuration packaging command. The custom directory file is the file in the custom code module directory that corresponds to the development dependency information and the production dependency information. The custom directory file is the file that needs to be packaged, replaced or merged.

[0117] 208. Deploy the target configuration file and the customized directory file to obtain the target customized file.

[0118] In the embodiment of the present application, the target configuration file and the customized directory file may be replaced or merged to obtain a target customized file.

[0119] The embodiment of the present application provides a customized file compilation method, which can realize user personalized customization of the version through a target plug-in, and realize the replacement or fusion of the customized version and the baseline version through the target plug-in, quickly and accurately perform front-end configurable dynamic packaging compilation, facilitate unified development management, and reduce branch management costs.

[0120] like Figure 3 As shown, an embodiment of the present application provides a customized file compiling device, which may include:

[0121] Creating module 301, used to create a custom code module directory;

[0122] The acquisition module 302 is used to acquire a target configuration file and store it in a preset baseline directory. The target configuration file is generated according to the version customization information of the user;

[0123] The processing module 303 is used to read and package the target configuration file through the target plug-in in the front-end project configuration file;

[0124] The processing module 303 is further used to deploy the target configuration file and the customized code module directory according to the configuration packaging command to obtain the target customized file.

[0125] In some embodiments, the acquisition module 302 is specifically configured to acquire the user's version customization information in response to the user's input operation;

[0126] The processing module 303 is specifically configured to generate a target configuration file according to the version customization information and the preset template.

[0127] In some embodiments, the acquisition module 302 is specifically used to acquire a target dependency file, which includes at least: development dependency information, production dependency information, and configuration packaging commands;

[0128] The processing module 303 is specifically used to determine the custom directory file corresponding to the development dependency information and the production dependency information in the custom code module directory according to the configuration packaging command;

[0129] The processing module 303 is specifically used to deploy the target configuration file and the customized directory file to obtain the target customized file.

[0130] In some embodiments, the creation module 301 is further used to create a plug-in directory;

[0131] The processing module 303 is further used to read the custom code module directory through the target module in the plug-in directory to obtain file path information;

[0132] The processing module 303 is further used to read and package the target configuration file according to the file path information through the target plug-in in the front-end project configuration file.

[0133] In some embodiments, the creation module 301 is further used to generate code syntax in the plug-in directory;

[0134] The processing module 303 is further used to receive the user's version customization information through the constructor in the code syntax.

[0135] In some embodiments, the creation module 301 is further used to create a target method in the plug-in directory;

[0136] The acquisition module 302 is further used to acquire information parameters through a target method, where the information parameters include file information corresponding to the target plug-in;

[0137] The processing module 303 is further used to read the target configuration file according to the target plug-in in the front-end project configuration file, and replace the file information corresponding to the target plug-in with the target configuration file.

[0138] In the embodiments of the present application, each module can implement the customized file compilation method provided in the above method embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0139] like Figure 4 As shown, an embodiment of the present application further provides an electronic device, which may include:

[0140] A memory 401 storing executable program codes;

[0141] a processor 402 coupled to the memory 401;

[0142] The processor 402 calls the executable program code stored in the memory 401 to execute the custom file compiling method executed by the electronic device in the above-mentioned method embodiments.

[0143] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the custom file compilation method in the above method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0144] An embodiment of the present application also provides a computer program product, which stores a computer program. When the computer program is executed by a processor, the various processes of the customized file compilation method in the above method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0145] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media that include computer-usable program code.

[0146] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing 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 consecutive boxes 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 and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0147] In the present application, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0148] In this application, memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0149] In this application, a person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the computer-readable medium includes permanent and non-permanent, removable and non-removable storage media. The storage medium can implement information storage by any method or technology, and the information can be a computer-readable instruction, a data structure, a module of a program, or other data. Examples of computer storage media include, but are not limited to, Parallel Random Access Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Programmable Read-only Memory (PROM), Erasable Programmable Read Only Memory (EPROM), other types of Random Access Memory (RAM), Read-Only Memory (ROM), One-time Programmable Read-Only Memory (OTPROM), Electrically-Erasable Programmable Read-Only Memory (EEPROM), flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0150] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0151] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application. The above-mentioned multiple embodiments are not necessarily multiple independent embodiments. Dividing into multiple embodiments is only used to highlight the different technical features in different embodiments. Those skilled in the art should be aware that the above-mentioned multiple embodiments can also be combined in any way.

[0152] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0153] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0154] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0155] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.

[0156] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A custom file compilation method, It is characterized in that The method comprises: Create a custom code module directory; Obtaining a target configuration file and storing it in a preset baseline directory, wherein the target configuration file is generated according to version customization information of the user; Read and package the target configuration file through the target plug-in in the front-end project configuration file; According to the configuration packaging command, the target configuration file and the customized code module directory are deployed to obtain the target customized file.

2. The method according to claim 1, It is characterized in that The step of obtaining the target configuration file includes: In response to an input operation of a user, obtaining version customization information of the user; The target configuration file is generated according to the version customization information and the preset template.

3. The method according to claim 1, It is characterized in that The target configuration file and the customized code module directory are deployed according to the configuration packaging command to obtain the target customized file, including: Obtain a target dependency file, wherein the target dependency file includes at least: development dependency information, production dependency information, and the configuration packaging command; Determine, according to the configuration packaging command, a custom directory file in the custom code module directory corresponding to the development dependency information and the production dependency information; The target configuration file and the customized catalog file are deployed to obtain a target customized file.

4. The method according to claim 1, It is characterized in that Before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, the method further includes: Create a plugin directory; Read the custom code module directory through the target module in the plug-in directory to obtain file path information; The target configuration file is read and packaged through the target plug-in in the front-end project configuration file, including: The target configuration file is read and packaged according to the file path information through the target plug-in in the front-end project configuration file.

5. The method according to claim 4, It is characterized in that Before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, the method further includes: Generate code syntax in the plugin directory; The version customization information of the user is received through the constructor in the code syntax.

6. The method according to claim 4, It is characterized in that Before reading and packaging the target configuration file through the target plug-in in the front-end project configuration file, the method further includes: Create a target method in the plugin directory; Obtain information parameters through the target method, wherein the information parameters include file information corresponding to the target plug-in; The target configuration file is read and packaged through the target plug-in in the front-end project configuration file, including: According to the target plug-in in the front-end project configuration file, the target configuration file is read, and file information corresponding to the target plug-in is replaced by the target configuration file.

7. A custom file compilation device, It is characterized in that include: Create module, used to create a custom code module directory; An acquisition module is used to acquire a target configuration file and store it in a preset baseline directory, wherein the target configuration file is generated according to the version customization information of the user; A processing module, used for reading and packaging the target configuration file through the target plug-in in the front-end project configuration file; The processing module is further used to deploy the target configuration file and the customized code module directory according to the configuration packaging command to obtain the target customized file.

8. An electronic device, It is characterized in that include: A memory storing executable program code; and a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the customized file compiling method according to any one of claims 1 to 6.

9. A computer-readable storage medium, It is characterized in that include: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the customized file compiling method according to any one of claims 1 to 6 is implemented.