Linkis Console Compile
Second, the installation project
Execute the following commands in the terminal command line:
Introduction to the instruction:
- Pull the project package from the remote git repository to the local computer
- Enter the web root directory of the project: cd Linkis/web
- Dependencies required to install the project: npm install
This step only needs to be performed the first time you use it.
You need to make some configuration in the code, such as the back-end interface address, etc., such as the .env.development file in the root directory:
Package the project
You can package the project by executing the following commands on the terminal command line to generate compressed code:
After the command is successfully executed, a “dist” folder and a “*-${getVersion()}-dist.zip” compressed file will appear in the project web directory. The directory dist/dist is the packaged code. You can Put the folder directly into your static server, or refer to the installation document and use the script to deploy and install.
If you want to run the project on a local browser and change the code to view the effect, you need to execute the following commands in the terminal command line:
In the browser (Chrome browser is recommended) to access the application through the link: http://localhost:8080/. When you run the project in this way, the effect of your code changes will be dynamically reflected in the browser.
For example, the chrome browser: Configuration method under windows system:
- Close all chrome browsers.
- Create a new chrome shortcut, right-click “Properties”, select “Target” in the “Shortcut” tab, and add —args —disable-web-security —user-data-dir=C:\MyChromeDevUserData
- Open chrome browser via shortcut Configuration method under mac system: Execute the following command on the terminal command line (you need to replace yourname in the path, if it does not take effect, please check the location of the MyChromeDevUserData folder on your machine and copy the path to the “—user-data-dir=” in the following command)
common problem
npm install cannot succeed
If you encounter this situation, you can use the domestic Taobao npm mirror:
Then, replace the npm install command by executing the following command
Note that when the project is started and packaged, you can still use the npm run build and npm run serve commands