CN111443921A - Method, system and computer equipment for subpackage deployment of web front-end projects - Google Patents

Method, system and computer equipment for subpackage deployment of web front-end projects Download PDF

Info

Publication number
CN111443921A
CN111443921A CN202010227872.7A CN202010227872A CN111443921A CN 111443921 A CN111443921 A CN 111443921A CN 202010227872 A CN202010227872 A CN 202010227872A CN 111443921 A CN111443921 A CN 111443921A
Authority
CN
China
Prior art keywords
sub
project
module
deployment
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010227872.7A
Other languages
Chinese (zh)
Inventor
饶怡骏
梁春浪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202010227872.7A priority Critical patent/CN111443921A/en
Publication of CN111443921A publication Critical patent/CN111443921A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application is applicable to the technical field of web front ends, and provides a subcontracting deployment method, a subcontracting deployment system and computer equipment for web front-end projects, wherein the subcontracting deployment method comprises the following steps: acquiring a module sub-project, and generating a module sub-project according to the module sub-project, wherein the module sub-project comprises a main project and at least one sub-project; acquiring front-end routing table files of the module sub-items, and packaging the front-end routing table files of the module sub-items as entry files of the sub-projects; introducing the entry files packed by the sub-projects into the main project, wherein the main project comprises a routing configuration file; modifying the routing configuration file of the main project according to the inlet file packaged by the sub-project to obtain a target routing configuration file; and performing sub-package deployment on the sub-projects according to the target routing configuration file. The method and the device can improve development and deployment efficiency and enhance production and application stability.

Description

Method, system and computer equipment for subpackage deployment of web front-end projects
Technical Field
The present application relates to the field of web front-end technologies, and in particular, to a method, a system, and a computer device for deploying a sub-package of a web front-end project.
Background
In a single-page application project at the front end of a web, along with the increase of functions of the project, on one hand, the amount of codes to be compiled of the project is increased, so that the compiling speed is slow, and the deployment and development efficiency is influenced; on the other hand, the number of version releases is increased, which is not favorable for version management and development cooperation of a large web front-end single-page application project (hereinafter referred to as a large web-SPA project) with many function points and large code amount, and is easy to cause unstable production application functions.
In summary, as the functions of the project increase, the deployment and development efficiency of the web front-end single-page application project is low, and the production application function is unstable.
Disclosure of Invention
The embodiment of the application provides a method, a system and computer equipment for subpackage deployment of a web front-end project, and can solve the problems that in the prior art, as the functions of the project are increased, the deployment and development efficiency of the web front-end single-page application project is lower, and the production application function is unstable.
In a first aspect, an embodiment of the present application provides a method for deploying packages of web front-end projects, including:
acquiring a module sub-project, and generating a module sub-project according to the module sub-project, wherein the module sub-project is a sub-project extracted from a web front-end project, and the module sub-project comprises a main project and at least one sub-project;
acquiring a front end routing table file of the module sub-project, and packaging the front end routing table file of the module sub-project as an entry file of the sub-project, wherein the front end routing table file is used for maintaining a mapping relation between a page and a route which can be accessed by the module sub-project;
introducing the entry files packed by the sub-projects into the main project, wherein the main project comprises a routing configuration file;
modifying the routing configuration file of the main project according to the inlet file packaged by the sub-project to obtain a target routing configuration file;
and performing sub-package deployment on the sub-projects according to the target routing configuration file.
In a possible implementation manner of the first aspect, the step of introducing the entry file packaged in the sub-project into the main project includes:
introducing url path information of the entry files packaged by the sub-projects into the main project;
and when the main project is operated, downloading the inlet files packaged by the sub projects according to the url path information.
In a possible implementation manner of the first aspect, the step of performing packet deployment on the sub-project according to the target routing configuration file includes:
packaging the sub-projects by using a specified packaging tool to generate a deployment package;
and extracting a deployed path from the target routing configuration file, and deploying the deployment package to a web server according to the deployed path.
In a possible implementation manner of the first aspect, the step of performing packet deployment on the sub-project according to the target routing configuration file includes:
if the sub-project needs to be deployed into a plurality of web servers, acquiring the domain name of the web server corresponding to the sub-project;
adding the domain name of the web server corresponding to the sub-project to the resource file of the corresponding sub-project to obtain a target sub-project;
packaging the target sub-engineering to generate a deployment package;
and extracting a deployed path from the target routing configuration file, and deploying the deployment package to a web server according to the deployed path.
In a possible implementation manner of the first aspect, the method for deploying the subpackages further includes processing a global common component and a framework, and specifically includes:
acquiring the frame type of the module sub-item;
determining a mounting object of the global common component according to the frame type;
and mounting the global public component under the object global to the module sub-item according to the type of the mounting object of the global public component.
In a second aspect, an embodiment of the present application provides a subcontracting deployment system for a web front-end project, including:
the project engineering acquisition unit is used for acquiring module sub projects and generating module sub project engineering according to the module sub projects, wherein the module sub projects are sub projects extracted from a web front-end project, and the module sub project engineering comprises a main project and at least one sub project;
an entry file obtaining unit, configured to obtain a front-end routing table file of the module sub-item, and package the front-end routing table file of the module sub-item as an entry file of the sub-project, where the front-end routing table file is used to maintain a mapping relationship between a page accessible to the module sub-item and a route;
an entry file introducing unit, configured to introduce the entry file packed in the sub-project into the main project, where the main project includes a routing configuration file;
a target file obtaining unit, configured to modify the routing configuration file of the main project according to the entry file packaged by the sub-project, so as to obtain a target routing configuration file;
and the sub-package deployment unit is used for performing sub-package deployment on the sub-project according to the target routing configuration file.
In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the method for deploying packages of web front-end items according to the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and when executed by a processor, the computer program implements the method for deploying packages of web front-end projects according to the first aspect.
In a fifth aspect, the present application provides a computer program product, which when run on a computer device, causes the computer device to execute the method for deploying packages of web front-end items according to the first aspect.
In the embodiment of the application, by acquiring module sub-projects and generating module sub-project projects according to the module sub-projects, wherein the module sub-projects are sub-projects extracted from a web front-end project, the module sub-project projects comprise a main project and at least one sub-project, the main project and each module sub-project are decoupled in a sub-project mode, a plug-in configuration function sub-project can be realized, project function integration and maintenance can be more conveniently carried out, then front-end routing table files of the module sub-projects are acquired, the front-end routing table files of the module sub-projects are packaged to be used as entry files of the sub-projects, the front-end routing table files are used for maintaining the mapping relation between pages and routes accessible to the module sub-projects, the entry files packaged by the sub-projects are introduced into the main project, and the main project comprises the routing configuration files, and modifying the routing configuration file of the main project according to the inlet file packaged by the sub-projects to obtain a target routing configuration file, and performing sub-package deployment on the sub-projects according to the target routing configuration file. According to the method and the system, the large-scale web front-end single-page application project can be developed in sub-module sub-projects and compiled and deployed in a sub-package mode, meanwhile, the size of the project packaging file is reduced, the influence between project versions is isolated, the development and deployment efficiency can be improved, and the stability of production and application is enhanced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an implementation of a method for deploying packages of web front-end projects according to an embodiment of the present application;
fig. 2 is a flowchart of a specific implementation of a subpackage deployment method S105 for a web front-end project according to an embodiment of the present application;
fig. 3 is a flowchart of another specific implementation of the subpackage deployment method S105 for a web front-end project according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a specific implementation of the processing of the global common components and frameworks for the web project provided by an embodiment of the present application;
FIG. 5 is a block diagram of a subcontracting deployment system for web front-end projects according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a computer device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The method for deploying the sub-packages of the web front-end project provided by the embodiment of the application can be applied to intelligent terminals such as a server and a super-mobile personal computer (UMPC), and the embodiment of the application does not limit the specific type of the intelligent terminal.
Fig. 1 shows an implementation flow of a subcontracting deployment method for a web front-end project provided by an embodiment of the present application, where the method flow includes steps S101 to S105. The specific realization principle of each step is as follows:
s101: acquiring a module sub-project, and generating a module sub-project according to the module sub-project, wherein the module sub-project is a sub-project extracted from a web front-end project, and the module sub-project comprises a main project and at least one sub-project.
In the embodiment of the application, module sub-projects are extracted from the web-SPA project at the front end of the current web respectively, and independently generate module sub-project projects which are irrelevant to compiling. Specifically, the module sub-items are extracted according to the actual business scenario or functional scenario. The module sub-item includes at least one routing page. The module sub project needs to be divided into a main project and a plurality of sub projects, and the main project is used as an entrance of single-page application. The single page webapplication (SPA) is a professional word developed by a web front end, and the web application loading mode of a uniform resource location system (url) corresponding to an html page is different, and all urls of the single page application only correspond to one html page, and the display state change is controlled through a front end route. The main project is responsible for the initialization operation of the whole framework, the management of the routing in the operation and the management of the public component in the compiling, and is generally not responsible for the realization of the specific service function. The sub-project is used for being responsible for realizing specific business functions.
S102: and acquiring front-end routing table files of the module sub-projects, and packaging the front-end routing table files of the module sub-projects to be used as entry files of the sub-projects, wherein the front-end routing table files are used for maintaining the mapping relation between the pages accessible to the module sub-projects and the routes.
In this embodiment of the present application, specifically, the sub-project packages the front-end routing table file of the module sub-project as an entry file. The entry file of the sub-project is an entry file when the front-end project is compiled and packaged, the entry file is a routing file, the front-end compiling and packaging tool can analyze the code dependency relationship of the whole front-end project through the entry file, construct a code dependency tree of the front-end project, and compile and package the front-end code on the basis of the dependency tree. The packaging may be done using existing packaging tools of the web front-end such as webpack, gulp, grunt, etc. The front-end routing table file needs to maintain the relationship between all pages and routes accessible by the module sub-project. And the front-end routing table file comprises one-to-one mapping relation of all pages and routes which can be accessed by the module sub-items.
S103: and introducing the entry files packed by the sub-projects into the main project, wherein the main project comprises a routing configuration file.
Specifically, the step of introducing the entry file packaged in the sub-project into the main project specifically means introducing url path information of the entry file packaged in the sub-project, and when the main project is operated, the browser finally downloads the entry file of the sub-project according to the url path information.
In this embodiment of the present application, the introducing of the entry file packed in the sub-project into the main project refers to indexing or inserting the entry file packed in the sub-project into the main project, different packers have different introduction methods, for example, using a webpack entry file, a path of a packed entry file needs to be specified in an entry configuration item of a configuration file, the entry file packed in the sub-project may be introduced into the main project in multiple ways, and one is directly introduced through a script tag into an index file of a web single-page application of the main project (i.e., html, a file that a browser accesses to a single-page application first to access); the other method is to request (acquire) the content of the portal file from the server by xhr request, and insert the content into the page dom tree as js script by the dom operation of the browser.
In the embodiment of the application, when the main project runs at a browser end, the packed entry files of the sub-projects are loaded through a network protocol, and common protocols for web end development include http, https, websocket and the like. The sub-project is executed in a JavaScript execution environment of the browser. After the execution, the route configuration mapping table is mounted in the global object of the execution context of the current site of the browser, which is realized by encoding in the compiling entry file of the sub-project, and the route configuration is mounted on the global object of the execution context of the current site of the browser, wherein the packed codes of the sub-project do not participate in the compiling process of the main project.
In the embodiment of the application, because the web-SPA project is bound to integrate a routing framework, the association dependency between the main project and the module sub-project is realized through the dynamic injection of routing, so that the main project and the module sub-project which are not related to compiling can run cooperatively. The dynamic injection of the route is just relative to compiling time, and the static injection of the route at the compiling time refers to writing the route configuration in js needing compiling and introducing the route configuration into a js file for route initialization through common js specification or import of es 6; and the dynamic injection of the route is irrelevant to the compiling, the route configuration set of each module sub item is mounted to a global variable of a host environment of js operation when the js operation is carried out, such as a window variable of a js engine thread of a browser label page, and the route configuration set of each module sub item is obtained from the global variable in the operation process of a main item and then is merged into the route configuration set of the main item for route initialization.
For example, in the embodiment of the present application, the front-end routing table file of the module sub-project is used as the packing entry of the module sub-project. The front-end routing table file includes the mapping relation of the path and the page, and some additional parameters of the routing state and the jump, and the additional parameters are different in number, naming and value types according to different routing frames. The entry file of the main project is different from the entry file of the sub project, the entry file of the main project is an html file which can be rendered by a browser, the packed entry file of the sub project is obtained from a server through protocols such as http, https or websocket, url address information of the entry file of the sub project is specifically introduced through a script tag, and when the main project runs, the browser downloads the entry file to the main project to run according to the url address information of the entry file of the sub project.
S104: and modifying the routing configuration file of the main project according to the entry file packaged by the sub-project to obtain a target routing configuration file.
Specifically, the routing list of the sub-project is obtained from the return result after the entry file packed by the sub-project is loaded and operated, a routing list set is obtained after the entry file of the sub-project is operated in the main project, and the routing list file of the sub-project is added to the routing list set of the main project. And the routing configuration file of the main project realizes configuration injection integration of the sub-project through codes. And after the browser executes all the sub-projects, the browser executes the route configuration file of the main project to complete dynamic route injection. In this embodiment of the application, the route configuration object of the sub-project generated by the entry file of the sub-project executed by the browser is acquired from the global widnow object of the execution context of the website site of the browser, and the route configuration object of the sub-project generated by the entry file of the sub-project executed by the browser is added to the route configuration file of the main project.
Optionally, in this embodiment of the present application, when the routing configuration object of the sub-project is added to the routing configuration file of the main project, uniqueness of the routing path and name is checked, so that a problem of duplicate routing paths and names caused by asynchronous information can be discovered as early as possible.
S105: and performing sub-package deployment on the sub-projects according to the target routing configuration file.
In the embodiment of the application, the sub-projects are respectively packaged by using front-end engineering packaging tools such as webpack, parcel and the like, and the sub-projects which are respectively packaged are deployed according to the target routing configuration file.
As an embodiment of the present application, fig. 2 shows a specific implementation flow of step S105 of a subcontracting deployment method for a web front-end project provided by an embodiment of the present application, which is detailed as follows:
a1: and packaging the sub-projects by using a specified packaging tool to generate a deployment package. Specifically, the sub-projects are packaged by using a packaging tool of front-end engineering such as webpack, parcel and the like. And under the condition of a plurality of sub-projects, packaging the sub-projects by using a packaging tool respectively to generate a plurality of deployment packages.
A2: and extracting a deployed path from the target routing configuration file, and deploying the deployment package to a web server according to the deployed path.
In the embodiment of the application, the deployment package is deployed on the same web server. Specifically, a deployed path is extracted from the target routing configuration file, a root directory of a static web resource corresponding to a web server is determined, the deployment package is placed under a file named by names of respective module sub-items or other names capable of mapping the module sub-items, and production code influences among the module sub-items are identified and isolated through the file path of the file. The deployment package includes a main deployment package and a plurality of sub-deployment packages. For reference path configuration convenience, the entry file of the main deployment package can be directly exposed under the root directory. In the embodiment of the application, the deployment on the same web server can avoid solving the complex cross-domain problem, reduce network communication and avoid the loss of web performance.
Optionally, as a trial test of the present application, fig. 3 shows a specific implementation flow of step S105 of a subcontracting deployment method for a web front-end project provided in another embodiment of the present application, which is detailed as follows:
b1: and if the sub-project is to be deployed to a plurality of web servers, acquiring the domain name of the web server corresponding to the sub-project.
B2: and adding the domain name of the web server corresponding to the sub-project to the resource file of the corresponding sub-project to obtain a target sub-project.
B3: and packaging the target sub-engineering to generate a deployment package. Specifically, the sub-project adds domain names of respective corresponding web servers to all resource files before packaging, for example, a publicPath attribute can be configured in an entry in webpack3, and the publicPath attribute is set to a domain of a current debugging web server, for example, if a port of a current PC-started server is 8881, the publicPath is set to http:// localhost:8881, and if a module sub-project service is a service started on other computers, the module sub-project publicPath needs to be configured to http:// [ IP address ]:8881 (the same network segment can be accessed).
B4: and extracting a deployed path from the target routing configuration file, and deploying the deployment package to a web server according to the deployed path.
In the embodiment of the application, if the sub-projects are to be deployed to a plurality of web servers, the domain name of the web server corresponding to each sub-project is added to the resource file of the sub-project to obtain the target sub-project, and then deployment packages generated by packaging the target sub-project are respectively deployed to the corresponding web servers.
In the embodiment of the application, if a deployment package is required to be deployed in a plurality of web servers respectively, debugging and configuration are required to be carried out on an opening environment in advance, specifically, a main project and a corresponding sub project which needs to be developed are downloaded to a personal computer, compiling and debugging of the main project are executed, and then the compiling of the sub project is executed, wherein a compiling target directory of the sub project is configured to be under a web static resource directory of the main project debugging web server, however, due to the configuration of some front-end construction tools, the main project debugging server cannot be loaded from the corresponding directory of a computer hard disk, if web-dev-midleware is used as a middleware for developing and debugging in a weback 3, since the web-dev-midleware compatible with webpack3 can only load a compiling file from an internal memory, a configuration obtained from a specified directory of the hard disk is not provided, and at this time, only the construction of the opening environment debugging configuration can be completed by solving a cross-domain problem, optionally, the step of debugging and configuring the operating sub project debugging address of the operating web server also comprises the step of obtaining a UR address of the debugging web server, and introducing the operating sub project into a packaged entry 6335 of the operating sub project.
Optionally, as an embodiment of the present application, the method for deploying subpackages of web front-end items further includes processing a global common component and a framework of the web front-end item. As shown in FIG. 4, the step of processing the globally common components and frameworks for the web project comprises:
c1: and acquiring the frame type of the module sub-item.
C2: and determining a mounting object of the global common component according to the frame type.
C3: and mounting the global public component under the object global to the module sub-item according to the mounting object of the global public component. In particular, the processing of the global common components and frameworks is to hang them under the project global object, and is not suitable for separate compilation in the module sub-project. If vuejs and iview frameworks are used, the components of the iview need to be mounted under the vue object of the project global, and each module sub-project cannot be introduced into the vuejs and iview frameworks respectively.
Optionally, in the embodiment of the present application, a planning principle of project version management for a web front-end project is that each version branch only allows one module sub-project code to be modified, and does not allow a plurality of module sub-project codes to be modified on one version branch, so that influences between project version branches are better isolated, and stability of production application functions is improved.
By acquiring module sub-projects and generating module sub-project projects according to the module sub-projects, wherein the module sub-projects are sub-projects extracted from a web front-end project, the module sub-project projects comprise a main project and at least one sub-project, the main project and each module sub-project are decoupled in a sub-project mode, a plug-in configuration function sub-project can be realized, project function integration and maintenance can be more conveniently carried out, then front-end routing table files of the module sub-projects are acquired, the front-end routing table files of the module sub-projects are packaged to be used as entry files of the sub-projects, the front-end routing table files are used for maintaining mapping relations between pages and routes accessible to the module sub-projects, the entry files packaged by the sub-projects are introduced into the main project, and the main project comprises routing configuration files, and modifying the routing configuration file of the main project according to the inlet file packaged by the sub-projects to obtain a target routing configuration file, and performing sub-package deployment on the sub-projects according to the target routing configuration file. According to the method and the system, the large-scale web front-end single-page application project can be developed in sub-module sub-projects and compiled and deployed in a sub-package mode, meanwhile, the size of the project packaging file is reduced, the influence between project versions is isolated, the development and deployment efficiency can be improved, and the stability of production and application is enhanced.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Corresponding to the method for deploying the subpackage of the web front-end project described in the above embodiments, fig. 5 shows a structural block diagram of the system for deploying the subpackage of the web front-end project provided by the embodiments of the present application, and for convenience of explanation, only the parts related to the embodiments of the present application are shown.
Referring to fig. 5, the system for deploying subpackages of web front-end projects comprises: project acquisition unit 51, portal file acquisition unit 52, portal file introduction unit 53, target file acquisition unit 54, and subpackage deployment unit 55, wherein:
a project engineering obtaining unit 51, configured to obtain a module sub-project, and generate a module sub-project engineering according to the module sub-project, where the module sub-project is a sub-project extracted from a web front-end project, and the module sub-project engineering includes a main project and at least one sub-project;
an entry file obtaining unit 52, configured to obtain a front-end routing table file of the module sub-item, and package the front-end routing table file of the module sub-item as an entry file of the sub-project, where the front-end routing table file is used to maintain a mapping relationship between a page accessible to the module sub-item and a route;
an entry file importing unit 53, configured to import the entry file packed in the sub-project into the main project, where the main project includes a routing configuration file;
a target file obtaining unit 54, configured to modify the routing configuration file of the main project according to the entry file packaged in the sub-project, so as to obtain a target routing configuration file;
and the sub-package deployment unit 55 is configured to perform sub-package deployment on the sub-projects according to the target routing configuration file.
Optionally, the entry file importing unit 53 includes:
the information introducing module is used for introducing url path information of the entry files packed by the sub-projects into the main project;
and the file downloading module is used for downloading the inlet files packaged by the sub-projects according to the url path information when the main project is operated.
Optionally, the subpackage deployment unit 55 includes:
the first packing module is used for packing the sub-projects to generate a deployment package by utilizing a specified packing tool;
the first deployment module is used for extracting a deployment path from the target routing configuration file and deploying the deployment package to the web server according to the deployment path.
Optionally, the subpackage deployment unit 55 includes:
the domain name information acquisition module is used for acquiring domain names of the web servers corresponding to the sub-projects if the sub-projects are to be deployed into a plurality of web servers;
the target sub-project generating module is used for adding the domain name of the web server corresponding to the sub-project to the resource file of the corresponding sub-project to obtain a target sub-project;
the second packaging module is used for packaging the target sub-engineering to generate a deployment package;
and the second deployment module is used for extracting a deployment path from the target routing configuration file and deploying the deployment package to the web server according to the deployment path.
Optionally, the subcontract deployment system further comprises a common component processing unit 56, configured to process the global common components of the module sub-items: the common component processing unit 56 specifically includes:
the frame type acquisition module is used for acquiring the frame types of the sub items of the module;
the object type acquisition module is used for determining a mounting object of the global common component according to the frame type;
and the component mounting module is used for mounting the global public component under the object global to the module sub-item according to the mounting object of the global public component.
In the embodiment of the application, by acquiring module sub-projects and generating module sub-project projects according to the module sub-projects, wherein the module sub-projects are sub-projects extracted from a web front-end project, the module sub-project projects include a main project and at least one sub-project, the main project and each module sub-project are decoupled in a sub-project mode, a plug-in configuration function sub-project can be realized, project function integration and maintenance can be more conveniently performed, then a front-end routing table file of the module sub-project is acquired, the front-end routing table file of the module sub-project is packaged to be used as an entry file of the sub-project, wherein the front-end routing table file is used for maintaining a mapping relation between a page and a route which can be accessed by the module sub-project, the entry file packaged by the sub-project is introduced into the main project, and the main project includes a routing configuration file, and modifying the routing configuration file of the main project according to the inlet file packaged by the sub-projects to obtain a target routing configuration file, and performing sub-package deployment on the sub-projects according to the target routing configuration file. According to the method and the system, the large-scale web front-end single-page application project can be developed in sub-module sub-projects and compiled and deployed in a sub-package mode, meanwhile, the size of the project packaging file is reduced, the influence between project versions is isolated, the development and deployment efficiency can be improved, and the stability of production and application is enhanced.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
Embodiments of the present application further provide a computer-readable storage medium, which stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the method for deploying packetization of a web front-end item are implemented as shown in any one of fig. 1 to 4.
The embodiment of the present application further provides a computer device, which includes a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, where the processor executes the computer readable instructions to implement the steps of any one of the methods for deploying packetization of a web front-end item, as shown in fig. 1 to 4.
The embodiment of the present application further provides a computer program product, which when running on a server, causes the server to execute the steps of implementing the subcontracting deployment method for a web front-end project as shown in any one of fig. 1 to fig. 4.
FIG. 6 is a schematic diagram of a computer device provided by an embodiment of the present application. As shown in fig. 6, the computer device 6 of this embodiment includes: a processor 60, a memory 61, and computer readable instructions 62 stored in the memory 61 and executable on the processor 60. The processor 60, when executing the computer readable instructions 62, implements the steps in the above-described method embodiment for deploying a package of web front-end items, such as the steps S101 to S105 shown in fig. 1. Alternatively, the processor 60, when executing the computer readable instructions 62, implements the functions of the modules/units in the system embodiments described above, such as the functions of the units 51 to 55 shown in fig. 5.
Illustratively, the computer readable instructions 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to accomplish the present application. The one or more modules/units may be a series of computer-readable instruction segments capable of performing certain functions, which are used to describe the execution of the computer-readable instructions 62 in the computer device 6.
The computer device 6 may be a server. The computer device 6 may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a computer device 6 and is not intended to limit the computer device 6 and may include more or fewer components than shown, or some components may be combined, or different components, for example, the computer device 6 may also include input output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. The memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the computer device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the computer device 6. The memory 61 is used to store the computer readable instructions and other programs and data required by the computer device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or means of computer program code carrying means/terminal device, recording medium, computer Memory, Read-Only Memory (ROM), Random-access Memory (RAM), electrical carrier wave signals, telecommunication signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A subcontracting deployment method of a web front-end project is characterized by comprising the following steps:
acquiring a module sub-project, and generating a module sub-project according to the module sub-project, wherein the module sub-project is a sub-project extracted from a web front-end project, and the module sub-project comprises a main project and at least one sub-project;
acquiring a front end routing table file of the module sub-project, and packaging the front end routing table file of the module sub-project as an entry file of the sub-project, wherein the front end routing table file is used for maintaining a mapping relation between a page and a route which can be accessed by the module sub-project;
introducing the entry files packed by the sub-projects into the main project, wherein the main project comprises a routing configuration file;
modifying the routing configuration file of the main project according to the inlet file packaged by the sub-project to obtain a target routing configuration file;
and performing sub-package deployment on the sub-projects according to the target routing configuration file.
2. The subcontracting deployment method according to claim 1, wherein the step of introducing the entry file packaged by the sub-project into the main project comprises:
introducing url path information of the entry files packaged by the sub-projects into the main project;
and when the main project is operated, downloading the inlet files packaged by the sub projects according to the url path information.
3. The method for deploying subpackages according to claim 1, wherein the step of deploying the sub-projects according to the target routing configuration file by subpackaging comprises the following steps:
packaging the sub-projects by using a specified packaging tool to generate a deployment package;
and extracting a deployed path from the target routing configuration file, and deploying the deployment package to a web server according to the deployed path.
4. The method for deploying subpackages according to claim 1, wherein the step of deploying the sub-projects according to the target routing configuration file by subpackaging comprises the following steps:
if the sub-project needs to be deployed into a plurality of web servers, acquiring the domain name of the web server corresponding to the sub-project;
adding the domain name of the web server corresponding to the sub-project to the resource file of the corresponding sub-project to obtain a target sub-project;
packaging the target sub-engineering to generate a deployment package;
and extracting a deployed path from the target routing configuration file, and deploying the deployment package to a web server according to the deployed path.
5. The subcontract deployment method according to claim 1, wherein the subcontract deployment method further comprises processing a global common component and a framework, and specifically comprises:
acquiring the frame type of the module sub-item;
determining a mounting object of the global common component according to the frame type;
and mounting the global public component under the object global to the module sub-item according to the mounting object of the global public component.
6. A system for subcontracting deployment of web front-end projects, comprising:
the project engineering acquisition unit is used for acquiring module sub projects and generating module sub project engineering according to the module sub projects, wherein the module sub projects are sub projects extracted from a web front-end project, and the module sub project engineering comprises a main project and at least one sub project;
an entry file obtaining unit, configured to obtain a front-end routing table file of the module sub-item, and package the front-end routing table file of the module sub-item as an entry file of the sub-project, where the front-end routing table file is used to maintain a mapping relationship between a page accessible to the module sub-item and a route;
an entry file introducing unit, configured to introduce the entry file packed in the sub-project into the main project, where the main project includes a routing configuration file;
a target file obtaining unit, configured to modify the routing configuration file of the main project according to the entry file packaged by the sub-project, so as to obtain a target routing configuration file;
and the sub-package deployment unit is used for performing sub-package deployment on the sub-project according to the target routing configuration file.
7. The subcontract deployment system of claim 6, wherein the subcontract deployment unit comprises:
the domain name information acquisition module is used for acquiring domain names of the web servers corresponding to the sub-projects if the sub-projects are to be deployed into a plurality of web servers;
the target sub-project generating module is used for adding the domain name of the web server corresponding to the sub-project to the resource file of the corresponding sub-project to obtain a target sub-project;
the second packaging module is used for packaging the target sub-engineering to generate a deployment package;
and the second deployment module is used for extracting a deployment path from the target routing configuration file and deploying the deployment package to the web server according to the deployment path.
8. The subcontract deployment system of claim 6, further comprising a common component processing unit to process globally common components of the module sub-items:
the common component processing unit specifically includes:
the frame type acquisition module is used for acquiring the frame types of the sub items of the module;
the object type acquisition module is used for determining a mounting object of the global common component according to the frame type;
and the component mounting module is used for mounting the global public component under the object global to the module sub-item according to the mounting object of the global public component.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method for subcontracting deployment of web front-end items according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for subcontracting web front-end projects according to any one of claims 1 to 5.
CN202010227872.7A 2020-03-27 2020-03-27 Method, system and computer equipment for subpackage deployment of web front-end projects Pending CN111443921A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010227872.7A CN111443921A (en) 2020-03-27 2020-03-27 Method, system and computer equipment for subpackage deployment of web front-end projects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010227872.7A CN111443921A (en) 2020-03-27 2020-03-27 Method, system and computer equipment for subpackage deployment of web front-end projects

Publications (1)

Publication Number Publication Date
CN111443921A true CN111443921A (en) 2020-07-24

Family

ID=71649214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010227872.7A Pending CN111443921A (en) 2020-03-27 2020-03-27 Method, system and computer equipment for subpackage deployment of web front-end projects

Country Status (1)

Country Link
CN (1) CN111443921A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966337A (en) * 2020-07-28 2020-11-20 苏州浪潮智能科技有限公司 Vue-based front-end multi-project display method, system, equipment and storage medium
CN112148303A (en) * 2020-09-28 2020-12-29 Oppo(重庆)智能科技有限公司 File generation method, device, terminal and storage medium
CN112199080A (en) * 2020-09-28 2021-01-08 上海上讯信息技术股份有限公司 Webpack construction method and equipment for vuejs project
CN112306528A (en) * 2020-11-04 2021-02-02 北京焦点新干线信息技术有限公司 Data updating method and device
CN112437092A (en) * 2020-12-03 2021-03-02 许昌学院 Non-invasive method for sharing session in distributed system
CN112685029A (en) * 2020-12-30 2021-04-20 京东数字科技控股股份有限公司 Visual template generation method, device, equipment and storage medium
CN112688804A (en) * 2020-12-18 2021-04-20 中国平安财产保险股份有限公司 Service platform deployment method, device, equipment and storage medium
CN112783514A (en) * 2020-12-31 2021-05-11 罗普特科技集团股份有限公司 Method and system for deployment management of web front-end project
CN113076146A (en) * 2021-03-09 2021-07-06 北京一亩田新农网络科技有限公司 Dynamic APK loading method, device, system and medium
CN113157345A (en) * 2021-04-30 2021-07-23 中国工商银行股份有限公司 Automatic starting method and device for front-end engineering
CN113282541A (en) * 2021-06-04 2021-08-20 网易(杭州)网络有限公司 File calling method and device and electronic equipment
CN113312032A (en) * 2021-06-25 2021-08-27 深圳集智数字科技有限公司 Front-end project resource updating method and device, electronic equipment and storage medium
CN113946350A (en) * 2021-10-28 2022-01-18 苏州万店掌网络科技有限公司 Deployment method and system of shared working space
CN114489758A (en) * 2022-02-14 2022-05-13 北京京东振世信息技术有限公司 Page isolation method, page rendering method, device, equipment and computer medium
CN115086162A (en) * 2021-03-02 2022-09-20 京东科技控股股份有限公司 Project deployment method, device, electronic equipment, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017036309A1 (en) * 2015-08-31 2017-03-09 阿里巴巴集团控股有限公司 Page rendering method, device and apparatus
CN109032659A (en) * 2018-07-20 2018-12-18 珠海宏桥高科技有限公司 Single-page applies the method based on configuration reference remote pages component
CN110764775A (en) * 2019-09-06 2020-02-07 平安普惠企业管理有限公司 Application program integration method and device, storage medium and server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017036309A1 (en) * 2015-08-31 2017-03-09 阿里巴巴集团控股有限公司 Page rendering method, device and apparatus
CN109032659A (en) * 2018-07-20 2018-12-18 珠海宏桥高科技有限公司 Single-page applies the method based on configuration reference remote pages component
CN110764775A (en) * 2019-09-06 2020-02-07 平安普惠企业管理有限公司 Application program integration method and device, storage medium and server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ORALINGE: "多系统集成:vue大型项目之分模块运行/打包", pages 1 - 10, Retrieved from the Internet <URL:https://blog.csdn.net/Oralinge/article/details/103813020> *

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966337A (en) * 2020-07-28 2020-11-20 苏州浪潮智能科技有限公司 Vue-based front-end multi-project display method, system, equipment and storage medium
CN111966337B (en) * 2020-07-28 2022-12-27 苏州浪潮智能科技有限公司 Front-end multi-project display method, system, equipment and storage medium based on Vue
CN112148303B (en) * 2020-09-28 2024-05-28 Oppo(重庆)智能科技有限公司 File generation method, device, terminal and storage medium
CN112148303A (en) * 2020-09-28 2020-12-29 Oppo(重庆)智能科技有限公司 File generation method, device, terminal and storage medium
CN112199080A (en) * 2020-09-28 2021-01-08 上海上讯信息技术股份有限公司 Webpack construction method and equipment for vuejs project
CN112199080B (en) * 2020-09-28 2023-02-17 上海上讯信息技术股份有限公司 Webpack construction method and equipment for vuejs project
CN112306528B (en) * 2020-11-04 2023-12-08 北京博点智合科技有限公司 Data updating method and device
CN112306528A (en) * 2020-11-04 2021-02-02 北京焦点新干线信息技术有限公司 Data updating method and device
CN112437092A (en) * 2020-12-03 2021-03-02 许昌学院 Non-invasive method for sharing session in distributed system
CN112688804A (en) * 2020-12-18 2021-04-20 中国平安财产保险股份有限公司 Service platform deployment method, device, equipment and storage medium
CN112688804B (en) * 2020-12-18 2023-09-19 中国平安财产保险股份有限公司 Service platform deployment method, device, equipment and storage medium
CN112685029A (en) * 2020-12-30 2021-04-20 京东数字科技控股股份有限公司 Visual template generation method, device, equipment and storage medium
CN112783514A (en) * 2020-12-31 2021-05-11 罗普特科技集团股份有限公司 Method and system for deployment management of web front-end project
CN112783514B (en) * 2020-12-31 2022-06-14 罗普特科技集团股份有限公司 Method and system for deployment management of web front-end project
CN115086162A (en) * 2021-03-02 2022-09-20 京东科技控股股份有限公司 Project deployment method, device, electronic equipment, system and storage medium
CN113076146A (en) * 2021-03-09 2021-07-06 北京一亩田新农网络科技有限公司 Dynamic APK loading method, device, system and medium
CN113076146B (en) * 2021-03-09 2024-06-07 北京一亩田新农网络科技有限公司 Dynamic APK loading method, device, system and medium
CN113157345A (en) * 2021-04-30 2021-07-23 中国工商银行股份有限公司 Automatic starting method and device for front-end engineering
CN113282541B (en) * 2021-06-04 2023-08-11 网易(杭州)网络有限公司 File calling method and device and electronic equipment
CN113282541A (en) * 2021-06-04 2021-08-20 网易(杭州)网络有限公司 File calling method and device and electronic equipment
CN113312032A (en) * 2021-06-25 2021-08-27 深圳集智数字科技有限公司 Front-end project resource updating method and device, electronic equipment and storage medium
CN113946350A (en) * 2021-10-28 2022-01-18 苏州万店掌网络科技有限公司 Deployment method and system of shared working space
CN114489758A (en) * 2022-02-14 2022-05-13 北京京东振世信息技术有限公司 Page isolation method, page rendering method, device, equipment and computer medium

Similar Documents

Publication Publication Date Title
CN111443921A (en) Method, system and computer equipment for subpackage deployment of web front-end projects
CN111680253B (en) Page application data packet generation method and device, computer equipment and storage medium
CN106201893B (en) A kind of Java bytecode debugger and adjustment method
CN110069259B (en) ID L file-based parsing method and device, electronic equipment and storage medium
CN110968325A (en) Applet conversion method and device
CN107885658B (en) Test preposition implementation method, device, terminal device and storage medium
CN113157274B (en) Software development method and device based on micro front end, electronic equipment and storage medium
CN114115904B (en) Information processing method, device, server and storage medium
CN103412754A (en) Dynamic language code execution method and device
CN112631649A (en) Intelligent contract management method, device, terminal equipment and medium
CN114356779A (en) Programming language debugging method and device and terminal equipment
CN114662022A (en) Application isolation method and device
US20190339953A1 (en) Optimizing a cache of compiled expressions by removing variability
CN117008920A (en) Engine system, request processing method and device, computer equipment and storage medium
CN112114870A (en) Method and device for packaging codes, terminal equipment and storage medium
CN112199080B (en) Webpack construction method and equipment for vuejs project
CN113568678A (en) Method and device for dynamically loading resources and electronic equipment
CN103365931A (en) Method and device for recording quick positioning function performances in performance analysis tool
CN110413336A (en) Exploration project starts method, apparatus, server and storage medium
CN112799674B (en) Execution method and device of intelligent contracts in block chain and node equipment
CN117234590B (en) Instruction set generation method, device, medium and equipment
CN115629739A (en) Front-end system implementation method, device, equipment and storage medium
US11995458B1 (en) Compiling user code as an extension of a host application in a browser environment
CN112256324B (en) Method and device for processing files in android application program construction process
CN110879705B (en) Page generation method, device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination