A Vue.js project for vscrawler frontend project
# install dependencies npm install # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build # build for production and view the bundle analyzer report npm run build --report # run unit tests npm run unit # run e2e tests npm run e2e # run all tests npm test
vscrawler do not associate frontend project and backend project with a building tool,generally the two project need to be isolated. user for vscrawler do work in java and dependent java backend project in many time. maybe a java programmer do not know how to use webpack to build this project or how to write vue code. it`s difficult to setup a npm environment.
so, you need package a production code use frontend building tool,and copy out file into javaEE WebApp directory in manual.
the quick deploy command like this:
# install dependencies npm install # build for production with minification npm run build # out file will in "./dist/" directory,so copy to backend cp -rf ./dist/ pathToBackendPeoject/vscrawler-web/src/main/resource/static/ #then build backend project
when design vscrawler frontend,we need reference local
css | js | html resource,and invoke backend api from vscrawler backend.
so we use a webpack server to load
css | js | html,and forward request into backend with a proxy setting.
the proxy setting file
const proxy = 'http://localhost:8080'
this config indicate there is a backend project running on
http://localhost:8080,wo start tomcat server on port
8080,and start frontend server on port
8081 with command
npm run dev and then open a browser for frontend dev environment with url