Skip to content

Commit

Permalink
chore: 🤖 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayKnight committed Nov 7, 2024
1 parent 52b6029 commit b2ce643
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
5 changes: 0 additions & 5 deletions .changeset/chilled-paws-shop.md

This file was deleted.

15 changes: 10 additions & 5 deletions packages/vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const removeIncompatiblePlugins = (plugin: PluginOption) =>
// Additionally, some internal Remix plugins rely on a `ctx` object to be initialized by
// the main Remix plugin, and may not function correctly without it. To address this, we
// filter out all Remix-related plugins.
!plugin.name.startsWith('remix');
!plugin.name.startsWith('remix') &&
// As React-Router plugin works the same as Remix plugin, also ignore it.
!plugin.name.startsWith('react-router');

interface Options {
identifiers?: IdentifierOption;
Expand Down Expand Up @@ -196,22 +198,25 @@ export function vanillaExtractPlugin({
const result: TransformResult = {
code: source,
map: { mappings: '' },
}
};

// 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) {
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')) {
if (cssFileFilter.test(file)) {
invalidateModule(fileIdToVirtualId(file));
}
}
Expand Down Expand Up @@ -248,4 +253,4 @@ export function vanillaExtractPlugin({
return css;
},
};
}
}

0 comments on commit b2ce643

Please sign in to comment.