File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
packages/vscode-tailwindcss Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 284
284
"_esbuild" : " node ../../esbuild.js src/extension.ts src/server.ts src/cssServer.ts --outdir=dist --external=pnpapi --external=vscode" ,
285
285
"dev" : " concurrently --raw --kill-others \" npm run watch\" \" npm run check -- --watch\" " ,
286
286
"watch" : " npm run clean && npm run _esbuild -- --watch" ,
287
- "build" : " npm run check && npm run clean && npm run _esbuild -- --minify && mv dist/server.js dist/tailwindServer.js" ,
287
+ "build" : " npm run check && npm run clean && npm run _esbuild -- --minify && mv dist/server.js dist/tailwindServer.js && mv dist/cssServer.js dist/tailwindModeServer.js " ,
288
288
"package" : " vsce package" ,
289
289
"publish" : " vsce publish" ,
290
290
"copy:notices" : " cp ../tailwindcss-language-server/ThirdPartyNotices.txt ./dist/ThirdPartyNotices.txt" ,
Original file line number Diff line number Diff line change @@ -193,19 +193,28 @@ export async function activate(context: ExtensionContext) {
193
193
)
194
194
195
195
let cssServerBooted = false
196
- function bootCssServer ( ) {
196
+ async function bootCssServer ( ) {
197
197
if ( cssServerBooted ) return
198
198
cssServerBooted = true
199
+
200
+ let module = context . asAbsolutePath ( path . join ( 'dist' , 'cssServer.js' ) )
201
+ let prod = path . join ( 'dist' , 'tailwindModeServer.js' )
202
+
203
+ try {
204
+ await Workspace . fs . stat ( Uri . joinPath ( context . extensionUri , prod ) )
205
+ module = context . asAbsolutePath ( prod )
206
+ } catch ( _ ) { }
207
+
199
208
let client = new LanguageClient (
200
209
'tailwindcss-intellisense-css' ,
201
210
'Tailwind CSS' ,
202
211
{
203
212
run : {
204
- module : context . asAbsolutePath ( path . join ( 'dist' , 'cssServer.js' ) ) ,
213
+ module,
205
214
transport : TransportKind . ipc ,
206
215
} ,
207
216
debug : {
208
- module : context . asAbsolutePath ( path . join ( 'dist' , 'cssServer.js' ) ) ,
217
+ module,
209
218
transport : TransportKind . ipc ,
210
219
options : {
211
220
execArgv : [ '--nolazy' , '--inspect=6051' ] ,
You can’t perform that action at this time.
0 commit comments