Skip to content

Commit

Permalink
srcからsrcの外をimportしてはいけない
Browse files Browse the repository at this point in the history
  • Loading branch information
erutobusiness committed Mar 30, 2024
1 parent b6802c6 commit 629cc02
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
6 changes: 0 additions & 6 deletions public/js/configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@ window.configs = {
windowConfig1: { keyString: 'windowConfigString1' },
windowConfig2: { keyString: 'windowConfigString2' },
};

export const EXPORT_CONFIGS = {
exportConfig1: { keyString: 'exportConfigString1' },
exportConfig2: { keyString: 'exportConfigString2' },
exportConfig3: { keyString: 'exportConfigString333' },
};
2 changes: 1 addition & 1 deletion src/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare global {
}
}

declare module '/public/js/configs.js' {
declare module '/js/configs.js' {
export const EXPORT_CONFIGS: Configs;
}

Expand Down
6 changes: 0 additions & 6 deletions src/pages/public/Public.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type FC, memo, useEffect, useState } from 'react';
import { EXPORT_CONFIGS } from '/public/js/configs.js';
import type { JsonConfigs } from '../../@types';
import { H1 } from '../../components/heading/H1';

Expand All @@ -21,11 +20,6 @@ const Component: FC = () => {
Object.keys(windowConfigs).map(key => (
<div key={key}>{windowConfigs?.[key]?.keyString}</div>
))}
<H1>JS: EXPORT_CONFIGS</H1>
{EXPORT_CONFIGS &&
Object.keys(EXPORT_CONFIGS).map(key => (
<div key={key}>{EXPORT_CONFIGS?.[key]?.keyString}</div>
))}
<H1>JSON: FETCH</H1>
{json &&
Object.keys(json).map(key =>
Expand Down

0 comments on commit 629cc02

Please sign in to comment.