File compiling method and device based on applet development project, medium and equipment
By using WXSS files to synchronize and compile Less files in applet development, the style confusion and file loss caused by developers ignoring Less files is solved, and the efficiency of development and maintenance is improved and real-time updates are achieved.
Patent Information
- Application Number
- CN202411584825.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-01-10
AI Technical Summary
During the development of mini-programs, developers often directly modify WXSS files and ignore the corresponding Less files, resulting in confusion in subsequent compilation styles and file loss, which brings inconvenience to development and maintenance.
By obtaining the Less files and WXSS files in the applet development project, and synchronizing the Less files with WXSS files, delete the WXSS files from the development directory, and compile the changed Less files in real time in the distribution directory, and launch the project online When compiling all Less files into WXSS files at one time, ensure that only Less files are retained in the development directory.
It effectively avoids style confusion and file loss, improves development and maintenance efficiency, and ensures real-time updates and efficiency in the development stage.
Smart Images

Figure CN119292611A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of applet development technology, and in particular to a file compilation method, device, medium and equipment based on an applet development project. Background Art
[0002] Mini Program development projects are application development projects for specific platforms (such as WeChat Mini Programs, Alipay Mini Programs, etc.). Mini Program development projects are lightweight, cross-platform, and fast to develop, and are an application development method with broad development prospects. During the development process, you can fully consider user needs, design a reasonable architecture, and choose appropriate technical solutions to ensure the quality and user experience of the Mini Program.
[0003] At present, in the process of developing mini-programs, CSS preprocessors such as Less are usually used to write styles, and then they are compiled into WXSS files for mini-programs to recognize. The existing technology usually uses open source tools such as easy-less to compile Less files into WXSS files, but developers sometimes directly modify WXSS files and ignore the corresponding Less files, resulting in chaotic styles during subsequent compilation and the risk of file loss, which in turn brings inconvenience to development and maintenance. Summary of the invention
[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect in the prior art that developers sometimes directly modify the WXSS file and ignore the corresponding Less file, resulting in style confusion during subsequent compilation and the risk of file loss, which in turn brings inconvenience to development and maintenance.
[0005] The present application provides a file compilation method based on a mini-program development project, the method comprising:
[0006] Get the Less files and WXSS files stored in the development directory of the mini program development project;
[0007] After synchronizing the Less file with the WXSS file, the WXSS file is deleted from the development directory;
[0008] When a change in the synchronized Less file is detected, the changed Less file is copied to the distribution directory where the final file generated after compilation is stored, and the changed Less file is compiled into a corresponding WXSS file in the distribution directory;
[0009] When the project goes online, all the Less files in the development directory are copied to the distribution directory, and all the Less files in the distribution directory are compiled into corresponding WXSS files at one time.
[0010] Optionally, the step of performing synchronization operation on the Less file by using the WXSS file includes:
[0011] Compile all Less files stored in the development directory into corresponding WXSS files at one time;
[0012] Compare the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed;
[0013] If yes, synchronize the changed items in the changed WXSS file to the corresponding Less file.
[0014] Optionally, comparing the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed includes:
[0015] The distributed version control system is used to compare the WXSS file before compilation with the WXSS file after compilation, and whether the WXSS file before compilation has been changed is determined based on the comparison result.
[0016] Optionally, compiling all the Less files into corresponding WXSS files at one time in the distribution directory includes:
[0017] Get pre-configured Gulp tasks;
[0018] According to the Gulp task, all the Less files in the distribution directory are compiled into corresponding WXSS files at one time.
[0019] The present application also provides a file compilation device based on a small program development project, comprising:
[0020] The file acquisition module is used to obtain the Less files and WXSS files stored in the development directory of the mini program development project;
[0021] A file deletion module, used for deleting the WXSS file from the development directory after performing a synchronization operation on the Less file using the WXSS file;
[0022] A real-time compilation module is used to copy the changed Less file to the distribution directory where the final file generated after compilation is stored when monitoring the change of the synchronized Less file, and compile the changed Less file into a corresponding WXSS file in the distribution directory;
[0023] The one-time compilation module is used to copy all the Less files in the development directory to the distribution directory when the project goes online, and compile all the Less files in the distribution directory into corresponding WXSS files at one time.
[0024] Optionally, the file deletion module uses the WXSS file to perform a synchronization operation on the Less file, including:
[0025] A file compilation module, used to compile all Less files stored in the development directory into corresponding WXSS files at one time;
[0026] The file comparison module is used to compare the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed;
[0027] If there is any change item synchronization, the change items in the changed WXSS file will be synchronized to the corresponding Less file.
[0028] Optionally, the file comparison module includes:
[0029] The file comparison submodule is used to compare the WXSS file before compilation with the WXSS file after compilation by using the distributed version control system, and determine whether the WXSS file before compilation has changed based on the comparison result.
[0030] Optionally, the one-time compilation module compiles all the Less files in the distribution directory into corresponding WXSS files at one time, including:
[0031] The task acquisition module is used to obtain pre-configured Gulp tasks;
[0032] The packaging and compilation module is used to compile all the Less files into corresponding WXSS files at one time in the distribution directory according to the Gulp task.
[0033] The present application also provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the file compilation method based on the mini-program development project as described in any of the above embodiments.
[0034] The present application also provides a computer device, comprising: one or more processors, and a memory;
[0035] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the file compilation method based on the mini-program development project as described in any one of the above embodiments are performed.
[0036] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0037] The file compilation method, device, medium and equipment based on the mini-program development project provided by the present application, when the Less file and WXSS file stored in the development directory of the mini-program development project are obtained, the WXSS file can be used to synchronize the Less file, and then the WXSS file can be deleted from the development directory, so that the non-corresponding Less files in the development directory can be matched to avoid style confusion; further, when the present application monitors the change of the synchronized Less file, the changed Less file can be copied to the distribution directory where the final file generated after compilation is stored, and the changed Less file can be compiled into the corresponding WXSS file in the distribution directory; and when the project is online, all the Less files in the development directory can be copied to the distribution directory, and all the Less files in the distribution directory can be compiled into the corresponding WXSS files at one time, so that only the Less files can be retained in the development directory, avoiding the developer's subsequent direct modification of the WXSS file and ignoring the corresponding Less file, thereby improving the development efficiency and maintenance efficiency, and the WXSS file is updated in real time during the development stage, which is efficient and convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art 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 paying creative labor.
[0039] Figure 1 A flowchart of a file compilation method based on a small program development project provided in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of a git file change record displayed in vscode provided in an embodiment of the present application;
[0041] Figure 3 An interactive diagram of the file compilation process provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of a file compilation device based on a small program development project provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only 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.
[0045] In one embodiment, Figure 1 As shown, Figure 1 A flowchart of a file compilation method based on a mini-program development project provided in an embodiment of the present application; the present application provides a file compilation method based on a mini-program development project, the method may include:
[0046] S110: Obtain the Less files and WXSS files stored in the development directory of the mini program development project.
[0047] In this step, during the development of a mini-program, CSS preprocessors such as Less are usually used to write styles, and then open source tools such as easy-less are used to compile Less files into WXSS files for mini-program recognition. Using the easy-less plug-in as a development method will cause the project to contain two style files, Less files and WXSS files. If the developer only modifies the WXSS file and ignores the corresponding Less file, it will cause style confusion during subsequent compilation and there is a risk of file loss, which will bring inconvenience to development and maintenance.
[0048] Based on this, this application can obtain the Less files and WXSS files stored in the development directory of the mini-program development project, and then optimize these two style files to solve the problem of style confusion during compilation and facilitate development and maintenance.
[0049] Among them, the aforementioned Less file is widely used in web development and can be used in various front-end frameworks and projects. It is a CSS preprocessor language. By compiling the Less code, a standard CSS file can be generated. It can also be used in combination with front-end technologies such as HTML and JavaScript to provide rich style effects for web pages. The WXSS file is mainly used for the interface style design of WeChat applets. It follows the CSS syntax specification and specifically provides style definitions for the view layer of the applets. It is used in conjunction with the WXML (WeiXin Markup Language) file of the applets to achieve the page layout and appearance presentation of the applets.
[0050] S120: After synchronizing the Less file with the WXSS file, delete the WXSS file from the development directory.
[0051] In this step, after obtaining the Less files and WXSS files stored in the development directory of the mini-program development project through S110, the WXSS file can be used to synchronize the Less file so that the WXSS files that may be modified can be matched one-to-one with the Less files. After synchronizing the Less files, the WXSS files are deleted from the development directory so that only the Less files are retained in the development directory. In this way, when developers modify files, they will not only modify the WXSS files but ignore the corresponding Less files, thereby effectively improving the management efficiency of project files.
[0052] S130: When a change in the synchronized Less file is detected, the changed Less file is copied to the distribution directory storing the final file generated after compilation, and the changed Less file is compiled into a corresponding WXSS file in the distribution directory.
[0053] In this step, after the WXSS file is deleted from the development directory through S120, in order to ensure that only the Less file is retained in the development directory, the present application can monitor the changes of the synchronized Less file. If there is any change, the changed Less file can be copied to the distribution directory where the final file generated after compilation is stored, and the changed Less file can be compiled into the corresponding WXSS file in the distribution directory. In this way, it can be ensured that only the Less file is retained in the development directory, and the technical effect achieved by the changed Less file can be viewed through the compiled WXSS file.
[0054] It is understandable that in mini-program development projects, build tools (such as WeChat mini-program developer tools, Webpack, etc.) are usually used to automatically generate a "dist" directory, which is used to store the final files generated after the project is built. The build tool will compile, compress, merge, and other operations on the source code according to the configuration and requirements of the project to generate the final distribution file. In addition, in the configuration file of the build tool, the output path, file naming rules, optimization options, etc. of the "dist" directory can be specified. Developers can adjust and optimize according to the specific requirements of the project. The file content in the distribution directory can include compiled code: page files containing mini-programs (usually compiled products of .wxml and .wxss), logic files (.js compiled code), etc. These files are optimized and processed to remove unnecessary comments and debugging information, are smaller in size, and load faster; they can also include resource files: may include compressed and optimized resource files such as pictures and icons. These resource files reduce the file size without affecting the quality, which is conducive to improving the performance of the mini-program.
[0055] S140: When the project goes online, all Less files in the development directory are copied to the distribution directory, and all Less files in the distribution directory are compiled into corresponding WXSS files at one time.
[0056] In this step, after deleting the WXSS file from the development directory through S120, in order to ensure that only Less files are retained in the development directory, this application can also copy all Less files in the development directory to the distribution directory when the project is launched, and compile all Less files in the distribution directory into corresponding WXSS files at one time.
[0057] Specifically, when the project is launched, this application can scan all the less files in the current development directory, and then copy all the Less files to the distribution directory, and generate the WXSS files corresponding to all the Less files in one click through the right-click menu options in the distribution directory, thereby achieving fast compilation.
[0058] In the above embodiment, after obtaining the Less files and WXSS files stored in the development directory of the mini-program development project, the WXSS file can be used to synchronize the Less files, and then the WXSS file can be deleted from the development directory, so that the non-corresponding Less files in the development directory can be matched to avoid style confusion; further, when the present application monitors the change of the synchronized Less file, the changed Less file can be copied to the distribution directory where the final file generated after compilation is stored, and the changed Less file can be compiled into the corresponding WXSS file in the distribution directory; and when the project is online, all the Less files in the development directory can be copied to the distribution directory, and all the Less files in the distribution directory can be compiled into the corresponding WXSS files at one time, so that only the Less files can be retained in the development directory, avoiding the developer's subsequent direct modification of the WXSS file and ignoring the corresponding Less file, thereby improving the development efficiency and maintenance efficiency, and the WXSS file can be updated in real time during the development stage, which is efficient and convenient.
[0059] In one embodiment, the synchronization operation of the Less file using the WXSS file in S120 may include:
[0060] S121: compile all the Less files stored in the development directory into corresponding WXSS files at one time.
[0061] S122: Compare the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed.
[0062] S123: If yes, synchronize the changed items in the changed WXSS file to the corresponding Less file.
[0063] In this embodiment, when the WXSS file is used to synchronize the Less file, all the Less files stored in the development directory can be scanned first, and then the WXSS files corresponding to all the Less files can be generated with one click through the right-click menu option. Then, the present application can compare the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has changed. If there is a change, the change item in the changed WXSS file can be synchronized to the corresponding Less file, so that the WXSS file that may be modified can be matched one-to-one with the Less file; if there is no change, it means that the current WXSS file and the Less file are already matched one-to-one. After the Less file is synchronized, the WXSS file can be deleted from the development directory so that only the Less file is retained in the development directory. In this way, when the developer modifies the file, the situation of only modifying the WXSS file and ignoring the corresponding Less file will not occur, thereby effectively improving the management efficiency of the project file.
[0064] In one embodiment, S122 compares the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed, which may include:
[0065] S1221: Using a distributed version control system, the WXSS file before compilation is compared with the WXSS file after compilation, and determining whether the WXSS file before compilation has been changed according to the comparison result.
[0066] In this embodiment, when comparing the WXSS file before compilation with the WXSS file after compilation, a distributed version control system may be used to perform the comparison, and determine whether the WXSS file before compilation has been changed based on the comparison result.
[0067] Among them, the above-mentioned distributed version control system can help developers effectively manage code, conduct team collaboration, and achieve continuous integration and deployment in mini-program development projects. For example, the version control function of the system can record the modification history of each file in the project, including who made what modification and when, which allows developers to view the evolution of the file at any time, convenient for backtracking and understanding the development of the project; in addition, the system can also use the version control function to tag specific versions in order to mark important milestones or release versions, which allows developers to easily find specific versions of the code.
[0068] Furthermore, when the present application uses a distributed version control system to compare the WXSS file before compilation with the WXSS file after compilation, the comparison result can also be displayed through an open source code editor (such as vscode). Figure 2 As shown, Figure 2 A schematic diagram of a git file change record displayed in vscode provided in an embodiment of the present application, comprising Figure 2 You can clearly see the changes in the WXSS file before and after compilation, and then synchronize the Less file based on the changes.
[0069] In one embodiment, Figure 3 As shown, Figure 3 The interactive diagram of the file compilation process provided in the embodiment of the present application; in S140, all the Less files are compiled into corresponding WXSS files at one time in the distribution directory, which may include:
[0070] S141: Get pre-configured Gulp tasks.
[0071] S142: Compile all the Less files into corresponding WXSS files at one time in the distribution directory according to the Gulp task.
[0072] In this embodiment, Figure 3 As shown in the figure, when compiling all Less files into corresponding WXSS files at one time, you can first obtain the pre-configured Gulp task, which means to automate common development tasks such as code compression, file merging, image optimization, etc. by defining a series of operation steps. By automating repetitive tasks, the time and workload of manual operations can be reduced. For example, using Gulp, you can automatically merge multiple CSS files into one file to reduce page loading time; you can also compress, optimize and format the code to improve the readability and performance of the code. For example, using Gulp, you can compress JavaScript and CSS files, reduce file size, and increase loading speed; you can also decompose the complex project build process into multiple manageable tasks to facilitate developers to debug and maintain. For example, using Gulp, you can set different tasks to handle the build requirements of the development environment and the production environment.
[0073] Therefore, the present application can configure the Gulp task in advance according to the actual project development requirements, so as to execute the Gulp task during the packaging process, thereby generating an ideal WXSS file in the distribution directory. Furthermore, after generating the WXSS file, the present application can also verify the packaging result to determine whether the packaging result meets the expected result.
[0074] The following is a description of a file compilation device based on a mini-program development project provided in an embodiment of the present application. The file compilation device based on a mini-program development project described below and the file compilation method based on a mini-program development project described above can be referenced to each other.
[0075] In one embodiment, Figure 4 As shown, Figure 4 A schematic diagram of the structure of a file compilation device based on a small program development project provided in an embodiment of the present application; the present application also provides a file compilation device based on a small program development project, which may include a file acquisition module 210, a file deletion module 220, a real-time compilation module 230, and a one-time compilation module 240, which specifically include the following:
[0076] The file acquisition module 210 is used to acquire the Less files and WXSS files stored in the development directory of the mini-program development project.
[0077] The file deletion module 220 is used to delete the WXSS file from the development directory after synchronizing the Less file with the WXSS file.
[0078] The real-time compilation module 230 is used to copy the changed Less file to the distribution directory storing the final file generated after compilation when monitoring the change of the synchronized Less file, and compile the changed Less file into the corresponding WXSS file in the distribution directory.
[0079] The one-time compilation module 240 is used to copy all the Less files in the development directory to the distribution directory when the project goes online, and compile all the Less files in the distribution directory into corresponding WXSS files at one time.
[0080] In the above embodiment, after obtaining the Less files and WXSS files stored in the development directory of the mini-program development project, the WXSS file can be used to synchronize the Less files, and then the WXSS file can be deleted from the development directory, so that the non-corresponding Less files in the development directory can be matched to avoid style confusion; further, when the present application monitors the change of the synchronized Less file, the changed Less file can be copied to the distribution directory where the final file generated after compilation is stored, and the changed Less file can be compiled into the corresponding WXSS file in the distribution directory; and when the project is online, all the Less files in the development directory can be copied to the distribution directory, and all the Less files in the distribution directory can be compiled into the corresponding WXSS files at one time, so that only the Less files can be retained in the development directory, avoiding the developer's subsequent direct modification of the WXSS file and ignoring the corresponding Less file, thereby improving the development efficiency and maintenance efficiency, and the WXSS file can be updated in real time during the development stage, which is efficient and convenient.
[0081] In one embodiment, the file deletion module 220 uses the WXSS file to perform synchronization operations on the Less file, which may include:
[0082] The file compilation module is used to compile all the Less files stored in the development directory into corresponding WXSS files at one time.
[0083] The file comparison module is used to compare the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed.
[0084] If there is any change item synchronization, the change items in the changed WXSS file will be synchronized to the corresponding Less file.
[0085] In one embodiment, the file comparison module may include:
[0086] The file comparison submodule is used to compare the WXSS file before compilation with the WXSS file after compilation by using the distributed version control system, and determine whether the WXSS file before compilation has changed based on the comparison result.
[0087] In one embodiment, the one-time compilation module 240 compiles all the Less files in the distribution directory into corresponding WXSS files at one time, including:
[0088] The task acquisition module is used to obtain pre-configured Gulp tasks.
[0089] The packaging and compilation module is used to compile all the Less files into corresponding WXSS files at one time in the distribution directory according to the Gulp task.
[0090] In one embodiment, the present application also provides a computer-readable storage medium, which stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the file compilation method based on the mini-program development project as described in any of the above embodiments.
[0091] In one embodiment, the present application also provides a computer device, including: one or more processors, and a memory.
[0092] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the file compilation method based on the mini-program development project as described in any one of the above embodiments are performed.
[0093] Indicatively, Figure 5 As shown, Figure 5 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 300 may be provided as a server. Figure 5 The computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301, for storing instructions executable by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to execute the file compilation method based on the applet development project of any of the above embodiments.
[0094] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.
[0095] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0096] Finally, it should be noted that, in this article, relational terms such as first and second, etc. 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 terms "include", "comprise" or any other variants thereof are 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 "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0097] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0098] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may 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 the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A file compilation method based on a small program development project, characterized in that: The method comprises: Get the Less files and WXSS files stored in the development directory of the mini program development project; After synchronizing the Less file with the WXSS file, the WXSS file is deleted from the development directory; When a change in the synchronized Less file is detected, the changed Less file is copied to the distribution directory where the final file generated after compilation is stored, and the changed Less file is compiled into a corresponding WXSS file in the distribution directory; When the project goes online, all the Less files in the development directory are copied to the distribution directory, and all the Less files in the distribution directory are compiled into corresponding WXSS files at one time.
2. The file compilation method based on the applet development project according to claim 1 is characterized in that: The using the WXSS file to perform synchronization operation on the Less file includes: Compile all Less files stored in the development directory into corresponding WXSS files at one time; Compare the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed; If yes, synchronize the changed items in the changed WXSS file to the corresponding Less file.
3. The file compilation method based on the applet development project according to claim 2 is characterized in that: The step of comparing the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed includes: The distributed version control system is used to compare the WXSS file before compilation with the WXSS file after compilation, and whether the WXSS file before compilation has been changed is determined based on the comparison result.
4. The file compilation method based on the applet development project according to claim 1 is characterized in that: The method of compiling all the Less files in the distribution directory into corresponding WXSS files at one time includes: Get pre-configured Gulp tasks; According to the Gulp task, all the Less files in the distribution directory are compiled into corresponding WXSS files at one time.
5. A file compilation device based on a small program development project, characterized in that: include: The file acquisition module is used to obtain the Less files and WXSS files stored in the development directory of the mini program development project; A file deletion module, used for deleting the WXSS file from the development directory after performing a synchronization operation on the Less file using the WXSS file; A real-time compilation module is used to copy the changed Less file to the distribution directory where the final file generated after compilation is stored when monitoring the change of the synchronized Less file, and compile the changed Less file into a corresponding WXSS file in the distribution directory; The one-time compilation module is used to copy all the Less files in the development directory to the distribution directory when the project goes online, and compile all the Less files in the distribution directory into corresponding WXSS files at one time.
6. The file compilation device based on the applet development project according to claim 5 is characterized in that: The file deletion module uses the WXSS file to perform synchronization operations on the Less file, including: A file compilation module, used to compile all Less files stored in the development directory into corresponding WXSS files at one time; The file comparison module is used to compare the WXSS file before compilation with the WXSS file after compilation to determine whether the WXSS file before compilation has been changed; If there is any change item synchronization, the change items in the changed WXSS file will be synchronized to the corresponding Less file.
7. The file compilation device based on the applet development project according to claim 6 is characterized in that: The file comparison module includes: The file comparison submodule is used to compare the WXSS file before compilation with the WXSS file after compilation by using the distributed version control system, and determine whether the WXSS file before compilation has changed based on the comparison result.
8. The file compilation device based on the applet development project according to claim 5, characterized in that: The one-time compilation module compiles all the Less files in the distribution directory into corresponding WXSS files at one time, including: The task acquisition module is used to obtain pre-configured Gulp tasks; The packaging and compilation module is used to compile all the Less files into corresponding WXSS files at one time in the distribution directory according to the Gulp task.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the file compilation method based on the mini-program development project as described in any one of claims 1 to 4.
10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the file compilation method based on the applet development project as described in any one of claims 1 to 4 are performed.