See README-project-create.md
npm run serve
npm run build
npm run test:unit
npm run test:e2e
npm run lint
The PPR web application is currently served via https://bcregistry.ca/cooperatives/ppr. This url represents
some technical debt and will need to be changed. The subpath cooperatives/ppr
appears in the three Openshift templates as APP_PATH; also in vue.config.js
and in src/utils/config-helper.ts
Also see CLI Vue Configuration Reference.
- In VS Code install the Debugger for Chrome plugin
- Launch the application:
npm run serve
- In VS Code:
- Go to the Debug and Run tab (
Ctrl+Shift+D
on Windows and Linux,Command+Shift+D
on Mac) - In the Launch selector, choose
Add Configuration...
- Choose
Chrome: Launch
, this will create alaunch.json
with contents similar to what's shown below - With the Launch selector, run
Launch Chrome against localhost
- Go to the Debug and Run tab (
Once you run the launch configuration, VS Code will open a new Chrome window and connect to the app for debugging. You can then add breakpoints and use the debugging features directly in VS Code.
Example launch.json
:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
Most browsers have tools for debugging web application. This example is for Chrome, but other browsers have similar tools available. For more comprehensive information on debugging in Chrome, see Get Started with Debugging JavaScript in Chrome DevTools
First, open up the DevTools:
- Launch the application:
npm run serve
- Open Chrome and navigate to the application:
http://localhost:8080
- Right click on the page and select
Inspect
It is possible to find the source and manually enter breakpoints in the sources tab, but this can be difficult. So, to
force a breakpoint, you can use the debugger
keyword in the application.
- In your IDE, navigate to the line of code where you would like the debugger to stop
- Enter in a single new line of code and save:
debugger
The page should hot-reload in the browser, and when the new debugger
statement is encountered, the Chrome DevTools
will break and you will be able to inspect the code and debug information.
Important: debugger
statements must be removed before the code is committed. Use this technique with care as
eslint and VS Code will not remind you to remove these statements.