Skip to content

Commit 1d0af70

Browse files
committed
rename prod server file
1 parent 9b0026c commit 1d0af70

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@
185185
}
186186
},
187187
"scripts": {
188-
"dev": "glob-exec --foreach --parallel \"src/*.ts\" -- \"ncc build {{file}} --watch -o dist/{{file.toString().replace(/^src\\//, '').replace(/\\.ts$/, '')}}\"",
189-
"build": "glob-exec --foreach --parallel \"src/*.ts\" -- \"ncc build {{file}} -o dist/{{file.toString().replace(/^src\\//, '').replace(/\\.ts$/, '')}}\"",
188+
"dev": "npm run clean && glob-exec --foreach --parallel \"src/*.ts\" -- \"ncc build {{file}} --watch -o dist/{{file.toString().replace(/^src\\//, '').replace(/\\.ts$/, '')}}\"",
189+
"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",
190190
"minify": "glob-exec --foreach --parallel \"dist/**/*.js\" -- \"terser {{file}} --compress --mangle --output {{file.toString()}}\"",
191191
"package": "vsce package",
192192
"publish": "vsce publish",
193-
"vscode:prepublish": "npm run clean && npm run build && npm run minify",
193+
"vscode:prepublish": "npm run build",
194194
"clean": "rimraf dist",
195195
"test": "jest"
196196
},

src/extension.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,15 @@ function getUserLanguages(folder?: WorkspaceFolder): Record<string, string> {
8282
return isObject(langs) ? langs : {}
8383
}
8484

85-
export function activate(context: ExtensionContext) {
85+
export async function activate(context: ExtensionContext) {
8686
let module = context.asAbsolutePath(path.join('dist', 'server', 'index.js'))
87+
let prod = path.join('dist', 'server', 'tailwindServer.js')
88+
89+
try {
90+
await Workspace.fs.stat(Uri.joinPath(context.extensionUri, prod))
91+
module = context.asAbsolutePath(prod)
92+
} catch (_) {}
93+
8794
let outputChannel: OutputChannel
8895

8996
context.subscriptions.push(

0 commit comments

Comments
 (0)