@modular-css/vite 30.0.6 → 30.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +2 -2
  3. package/vite.js +8 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 30.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1024](https://github.com/tivac/modular-css/pull/1024) [`1c9322f`](https://github.com/tivac/modular-css/commit/1c9322fd9a39d05da01df8a8c6bd43e9218f9df1) Thanks [@tivac](https://github.com/tivac)! - Vite 6 support
8
+
3
9
  ## 30.0.6
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-css/vite",
3
- "version": "30.0.6",
3
+ "version": "30.1.0",
4
4
  "description": "vite support for modular-css",
5
5
  "main": "./vite.js",
6
6
  "repository": {
@@ -31,6 +31,6 @@
31
31
  "@rollup/pluginutils": "^5.0.2"
32
32
  },
33
33
  "peerDependencies": {
34
- "vite": "^3 || ^4 || ^5"
34
+ "vite": "^3 || ^4 || ^5 || ^6"
35
35
  }
36
36
  }
package/vite.js CHANGED
@@ -151,7 +151,7 @@ module.exports = (
151
151
  },
152
152
 
153
153
  // Load the virtual CSS files
154
- async load(id, opts = false) {
154
+ async load(id) {
155
155
  log("load", id);
156
156
 
157
157
  // Only want this to run for the virtual CSS modules
@@ -168,24 +168,25 @@ module.exports = (
168
168
  }
169
169
 
170
170
  if(viteServer) {
171
- const node = await viteServer.moduleGraph.ensureEntryFromUrl(id);
171
+ const { moduleGraph } = this.environment || viteServer;
172
+ const thisModule = moduleGraph.getModuleById(id);
173
+
172
174
  const deps = graph.directDependenciesOf(fileKey(normalize(file)));
173
175
  const imported = filterByPrefix(FILE_PREFIX, deps).map((dep) => virtualize(slash(dep)));
174
176
 
175
- await Promise.all(imported.map((dep) => viteServer.moduleGraph.ensureEntryFromUrl(dep)));
177
+ await Promise.all(imported.map((dep) => moduleGraph.ensureEntryFromUrl(dep)));
176
178
 
177
179
  log("load deps", id, "=>", imported);
178
180
 
179
181
  const hmrDeps = imported;
180
182
 
181
- await viteServer.moduleGraph.updateModuleInfo(
182
- node,
183
+ await moduleGraph.updateModuleInfo(
184
+ thisModule,
183
185
  new Set(imported),
184
186
  null,
185
187
  new Set(hmrDeps),
186
188
  null,
187
- true,
188
- Boolean(opts.ssr),
189
+ false,
189
190
  );
190
191
  }
191
192