Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
rename prod server file
Brad Cornes <bradlc41@gmail.com>
3 years ago
2 changed files, 11 additions(+), 4 deletions(-)
M package.json -> package.json
diff --git a/package.json b/package.json
index d8ae7bef9af526970a31f8618c20f6a9b0d6de1f..ad12d55c10780560d87a92bbe7af26bdf2b3ac3a 100755
--- a/package.json
+++ b/package.json
@@ -185,12 +185,12 @@       }
     }
   },
   "scripts": {
-    "dev": "glob-exec --foreach --parallel \"src/*.ts\" -- \"ncc build {{file}} --watch -o dist/{{file.toString().replace(/^src\\//, '').replace(/\\.ts$/, '')}}\"",
-    "build": "glob-exec --foreach --parallel \"src/*.ts\" -- \"ncc build {{file}} -o dist/{{file.toString().replace(/^src\\//, '').replace(/\\.ts$/, '')}}\"",
+    "dev": "npm run clean && glob-exec --foreach --parallel \"src/*.ts\" -- \"ncc build {{file}} --watch -o dist/{{file.toString().replace(/^src\\//, '').replace(/\\.ts$/, '')}}\"",
+    "build": "npm run clean && glob-exec --foreach --parallel \"src/*.ts\" -- \"ncc build {{file}} -o dist/{{file.toString().replace(/^src\\//, '').replace(/\\.ts$/, '')}}\" && mv dist/server/index.js dist/server/tailwindServer.js && npm run minify",
     "minify": "glob-exec --foreach --parallel \"dist/**/*.js\" -- \"terser {{file}} --compress --mangle --output {{file.toString()}}\"",
     "package": "vsce package",
     "publish": "vsce publish",
-    "vscode:prepublish": "npm run clean && npm run build && npm run minify",
+    "vscode:prepublish": "npm run build",
     "clean": "rimraf dist",
     "test": "jest"
   },
M src/extension.ts -> src/extension.ts
diff --git a/src/extension.ts b/src/extension.ts
index fedd13edad3bcb47ab6e47e577b61b0b88d21e42..2cc66a187b7fd0eea20170a3e3b4c98e4e1dee88 100755
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -82,8 +82,15 @@   const langs = Workspace.getConfiguration('tailwindCSS', folder).includeLanguages
   return isObject(langs) ? langs : {}
 }
 
-export function activate(context: ExtensionContext) {
+export async function activate(context: ExtensionContext) {
   let module = context.asAbsolutePath(path.join('dist', 'server', 'index.js'))
+  let prod = path.join('dist', 'server', 'tailwindServer.js')
+
+  try {
+    await Workspace.fs.stat(Uri.joinPath(context.extensionUri, prod))
+    module = context.asAbsolutePath(prod)
+  } catch (_) {}
+
   let outputChannel: OutputChannel
 
   context.subscriptions.push(