@vanilla-extract/vite-plugin
Advanced tools
Comparing version 4.0.12 to 4.0.13
@@ -67,13 +67,2 @@ 'use strict'; | ||
} | ||
function addWatchFiles(fromId, files) { | ||
// We don't need to watch files in build mode | ||
if (config.command === 'build' && !config.build.watch) { | ||
return; | ||
} | ||
for (const file of files) { | ||
if (!file.includes('node_modules') && integration.normalizePath(file) !== fromId) { | ||
this.addWatchFile(file); | ||
} | ||
} | ||
} | ||
return { | ||
@@ -165,7 +154,3 @@ name: 'vanilla-extract', | ||
}); | ||
addWatchFiles.call(this, absoluteId, watchFiles); | ||
// We have to invalidate the virtual module, not the real one we just transformed | ||
invalidateModule(fileIdToVirtualId(absoluteId)); | ||
return { | ||
const result = { | ||
code: source, | ||
@@ -176,2 +161,20 @@ map: { | ||
}; | ||
// We don't need to watch files in build mode | ||
if (config.command === 'build' && !config.build.watch) { | ||
return result; | ||
} | ||
for (const file of watchFiles) { | ||
if (!file.includes('node_modules') && integration.normalizePath(file) !== absoluteId) { | ||
this.addWatchFile(file); | ||
} | ||
// We have to invalidate the virtual module & deps, not the real one we just transformed | ||
// The deps have to be invalidated in case one of them changing was the trigger causing | ||
// the current transformation | ||
if (file.endsWith('.css.ts')) { | ||
invalidateModule(fileIdToVirtualId(file)); | ||
} | ||
} | ||
return result; | ||
} | ||
@@ -178,0 +181,0 @@ }, |
@@ -67,13 +67,2 @@ 'use strict'; | ||
} | ||
function addWatchFiles(fromId, files) { | ||
// We don't need to watch files in build mode | ||
if (config.command === 'build' && !config.build.watch) { | ||
return; | ||
} | ||
for (const file of files) { | ||
if (!file.includes('node_modules') && integration.normalizePath(file) !== fromId) { | ||
this.addWatchFile(file); | ||
} | ||
} | ||
} | ||
return { | ||
@@ -165,7 +154,3 @@ name: 'vanilla-extract', | ||
}); | ||
addWatchFiles.call(this, absoluteId, watchFiles); | ||
// We have to invalidate the virtual module, not the real one we just transformed | ||
invalidateModule(fileIdToVirtualId(absoluteId)); | ||
return { | ||
const result = { | ||
code: source, | ||
@@ -176,2 +161,20 @@ map: { | ||
}; | ||
// We don't need to watch files in build mode | ||
if (config.command === 'build' && !config.build.watch) { | ||
return result; | ||
} | ||
for (const file of watchFiles) { | ||
if (!file.includes('node_modules') && integration.normalizePath(file) !== absoluteId) { | ||
this.addWatchFile(file); | ||
} | ||
// We have to invalidate the virtual module & deps, not the real one we just transformed | ||
// The deps have to be invalidated in case one of them changing was the trigger causing | ||
// the current transformation | ||
if (file.endsWith('.css.ts')) { | ||
invalidateModule(fileIdToVirtualId(file)); | ||
} | ||
} | ||
return result; | ||
} | ||
@@ -178,0 +181,0 @@ }, |
@@ -59,13 +59,2 @@ import path from 'path'; | ||
} | ||
function addWatchFiles(fromId, files) { | ||
// We don't need to watch files in build mode | ||
if (config.command === 'build' && !config.build.watch) { | ||
return; | ||
} | ||
for (const file of files) { | ||
if (!file.includes('node_modules') && normalizePath(file) !== fromId) { | ||
this.addWatchFile(file); | ||
} | ||
} | ||
} | ||
return { | ||
@@ -157,7 +146,3 @@ name: 'vanilla-extract', | ||
}); | ||
addWatchFiles.call(this, absoluteId, watchFiles); | ||
// We have to invalidate the virtual module, not the real one we just transformed | ||
invalidateModule(fileIdToVirtualId(absoluteId)); | ||
return { | ||
const result = { | ||
code: source, | ||
@@ -168,2 +153,20 @@ map: { | ||
}; | ||
// We don't need to watch files in build mode | ||
if (config.command === 'build' && !config.build.watch) { | ||
return result; | ||
} | ||
for (const file of watchFiles) { | ||
if (!file.includes('node_modules') && normalizePath(file) !== absoluteId) { | ||
this.addWatchFile(file); | ||
} | ||
// We have to invalidate the virtual module & deps, not the real one we just transformed | ||
// The deps have to be invalidated in case one of them changing was the trigger causing | ||
// the current transformation | ||
if (file.endsWith('.css.ts')) { | ||
invalidateModule(fileIdToVirtualId(file)); | ||
} | ||
} | ||
return result; | ||
} | ||
@@ -170,0 +173,0 @@ }, |
{ | ||
"name": "@vanilla-extract/vite-plugin", | ||
"version": "4.0.12", | ||
"version": "4.0.13", | ||
"description": "Zero-runtime Stylesheets-in-TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "dist/vanilla-extract-vite-plugin.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28935
592