You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
47
6
48
7
We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed.
@@ -53,6 +12,12 @@ We always recommend using the latest version of these commands bundled with the
53
12
sf plugins install @salesforce/plugin-lightning-dev@x.y.z
54
13
```
55
14
15
+
or
16
+
17
+
```bash
18
+
sf plugins install @salesforce/plugin-lightning-dev
19
+
```
20
+
56
21
## Issues
57
22
58
23
Please report any issues at https://github.com/forcedotcom/cli/issues
@@ -104,6 +69,72 @@ sf plugins link .
104
69
sf plugins
105
70
```
106
71
72
+
## LWR Sites Development Environment
73
+
74
+
Follow these instructions if you want to setup a dev environment for the `sf lightning dev site` command.
75
+
76
+
## Setup
77
+
78
+
1.[Enable Local Development] (https://developer.salesforce.com/docs/platform/lwc/guide/get-started-test-components.html#enable-local-dev)
79
+
80
+
2. Deploy some source files to your org from your SFDX project
81
+
82
+
```bash
83
+
sf org login web --alias dev --instance-url ${orgfarmUrl}
84
+
85
+
```
86
+
87
+
3. Add those source files to an LWR site in the Experience Builder and Publish the site (basePath: '/')
88
+
89
+
4. Follow the [Build the plugin locally](#build) instructions
90
+
91
+
5.[optional] Linking / Debugging LWR Source
92
+
93
+
```bash
94
+
# build and link lwr source
95
+
cd lwr
96
+
yarn && yarn link-lwr
97
+
98
+
# build and link plugin-lightning-dev source
99
+
cd plugin-lightning-dev
100
+
yarn && yarn build
101
+
yarn link-lwr
102
+
103
+
# SFDX Project
104
+
cd sfdx-project
105
+
106
+
# Login to your org
107
+
sf org login web --alias dev --instance-url https://login.test1.pc-rnd.salesforce.com/ (orgfarm needs instance url)
108
+
109
+
# run/debug the sf cli command (attach to the CLI from the LWR repo in VS Code)
110
+
NODE_OPTIONS="--inspect-brk" sf lightning dev site --target-org dev
111
+
```
112
+
113
+
Now you can Remote Attach to the CLI from the vscode debugger:
114
+
115
+
- Use the "Attach" launch configuration
116
+
- Run launch config from LWR repo if you want to debug LWR source
117
+
- Run launch config from plugin-lightning-dev source if you want to debug the SFDX plugin source specifically
118
+
119
+
If this doesn't work for whatever reason, you can always alias the build output directly like so:
120
+
121
+
```bash
122
+
alias sfdev="/{pathToGitDir}/plugin-lightning-dev/bin/run.js"
123
+
# SFDX Project
124
+
NODE_OPTIONS="--inspect-brk" sfdev lightning dev site --target-org dev
125
+
```
126
+
127
+
6. Make changes to your c-namespace components and you should see the browser refresh with those changes!
0 commit comments