@react-aria/optimize-locales-plugin 1.2.0 → 2.0.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.
@@ -1,7 +1,7 @@
1
1
  import {UnpluginInstance} from 'unplugin';
2
2
 
3
3
  type Options = {
4
- locales: readonly string[]
4
+ locales: readonly string[];
5
5
  };
6
6
 
7
7
  declare const plugin: UnpluginInstance<Options, false>;
package/LocalesPlugin.js CHANGED
@@ -17,7 +17,12 @@ module.exports = createUnplugin(({locales}) => {
17
17
  return {
18
18
  name: 'locales-plugin',
19
19
  resolveId(specifier, sourcePath, options) {
20
- if (!/[/\\](@react-stately|@react-aria|@react-spectrum|react-aria-components)[/\\]/.test(sourcePath) || options?.ssr) {
20
+ if (
21
+ !/[/\\](@react-stately|@react-aria|@react-spectrum|@adobe[/\\]react-spectrum|react-stately|react-aria|react-aria-components)[/\\]/.test(
22
+ sourcePath
23
+ ) ||
24
+ options?.ssr
25
+ ) {
21
26
  return;
22
27
  }
23
28
 
@@ -35,6 +40,8 @@ module.exports = createUnplugin(({locales}) => {
35
40
  });
36
41
 
37
42
  function localeMatches(localeToMatch, includedLocale) {
38
- return localeToMatch.language === includedLocale.language
39
- && (!includedLocale.region || localeToMatch.region === includedLocale.region);
43
+ return (
44
+ localeToMatch.language === includedLocale.language &&
45
+ (!includedLocale.region || localeToMatch.region === includedLocale.region)
46
+ );
40
47
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@react-aria/optimize-locales-plugin",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "main": "LocalesPlugin.js",
5
5
  "types": "LocalesPlugin.d.ts",
6
- "dependencies": {
7
- "unplugin": "^1.4.0"
8
- },
9
6
  "publishConfig": {
10
7
  "access": "public"
11
8
  },
12
- "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
9
+ "dependencies": {
10
+ "unplugin": "^2.3.11"
11
+ },
12
+ "gitHead": "1c84a49a1faf50b571c84e00bcf9c60b22ddd03e"
13
13
  }