ElementUI’s official access speed has been slow, and the company’s internal network cannot be accessed externally. So I took a look at the latest ElementUI API(2.13.2) deployment tutorial.

Let’s start with the renderings

ElementUI document deployment process

  1. Go to Github to download the latest elementui source code, which I downloaded locally using Git
git clone https://github.com/ElemeFE/element.git
Copy the code
  1. After downloading, go to the Element directory to install the dependencies
npm install
Copy the code
  1. Analysis of the directory found that the source document element in the examples directory

4. After analyzing package.json again, it is found that webpack.demo.js is configured to compile examples documents

"deploy:build": "npm run build:file && cross-env NODE_ENV=production webpack --config build/webpack.demo.js && echo element.eleme.io>>examples/element-ui/CNAME"
Copy the code
  1. Finally, use NPM to execute the following command to compile the examples document source code
npm run deploy:build
Copy the code
  1. The index. TPL under examples in the browser references many extranet JS, CSS, and SVG resources

  1. The third-party resources deployed on the Intranet cannot be accessed. Therefore, I manually download the third-party resources referenced in examples/index. TPL. And change index.tpl to a path reference reference relative to the server.

  1. Finally, all files are deployed on nginx. Here I take Windows Nginx as an example and put it in the HTML directory.

That’s how ElementUI’s latest API document was deployed. Please like, comment, and retweet if it helps

For more resources and first-hand blogs, please follow the public number: Programmer Push, get.