forked from Esri/arcgis-js-vscode-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
html.json
25 lines (25 loc) · 920 Bytes
/
html.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"Get the API from the CDN": {
"prefix": "getApi",
"body": [
"<link rel=\"stylesheet\" href=\"https://js.arcgis.com/${1|4.28,4.27,4.26,4.25,4.24,4.23,4.22,4.21,4.20,4.19,4.18,4.17,4.16,1.15,4.14|}/esri/css/main.css\">",
"<script src=\"https://js.arcgis.com/${2|4.28,4.27,4.26,4.25,4.24,4.23,4.22,4.21,4.20,4.19,4.18,4.17,4.16,4.15,4.14|}\"></script>"
],
"description": "Add script and link tags for jsapi"
},
"Set package name and location": {
"prefix": "dojoConfig",
"body": [
"<script>",
"\tconst locationPath = location.pathname.replace(/\\/[^\\/]+$/,\"\");",
"\twindow.dojoConfig = {",
"\t\tpackages:[{",
"\t\t\tname: \"app\",",
"\t\t\tlocation: locationPath + \"/app\"",
"\t\t}]",
"\t};",
"</script>"
],
"description": "Sets /app folder to be able to load packages using require([\"app/your_file.js\"]);"
}
}