Skip to content

Commit 3fed7f3

Browse files
Merge branch 'main' into fix/errors-and-unused-code-of-docs
2 parents 2ac4627 + 1fe0730 commit 3fed7f3

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/analytics/modules/analytics/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from 'wxt/modules';
99
import { relative, resolve } from 'node:path';
1010
import type { AnalyticsConfig } from './types';
11+
import { normalizePath } from 'wxt';
1112

1213
declare module 'wxt/utils/define-app-config' {
1314
export interface WxtAppConfig {
@@ -42,7 +43,7 @@ export default defineWxtModule({
4243
`import { createAnalytics } from '${
4344
process.env.NPM
4445
? clientModuleId
45-
: relative(wxtAnalyticsFolder, clientModuleId)
46+
: normalizePath(relative(wxtAnalyticsFolder, clientModuleId))
4647
}';`,
4748
`import { useAppConfig } from '#imports';`,
4849
``,

packages/wxt/src/core/utils/paths.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import systemPath from 'node:path';
22
import normalize from 'normalize-path';
33

44
/**
5-
* Converts system paths to normalized bundler path.\
6-
* On Windows and Unix, this returns paths with `/` instead of `\`.
5+
* Converts system paths to normalized bundler path.
6+
* On Windows, this returns paths with `/` instead of `\`.
77
*/
88
export function normalizePath(path: string): string {
99
return normalize(path);

0 commit comments

Comments
 (0)