Add path alias and update imports

This commit is contained in:
Logan Yang 2023-04-05 09:06:42 -07:00
parent d3650d8339
commit b6f4a49294
4 changed files with 11 additions and 8 deletions

View file

@ -1,11 +1,11 @@
import { WorkspaceLeaf, ItemView } from 'obsidian';
import { SharedState } from 'src/sharedState';
import SharedState from '@/sharedState';
import * as React from 'react';
import Chat from 'src/components/Chat';
import Chat from '@/components/Chat';
import { createRoot, Root } from 'react-dom/client';
import { AppContext } from 'src/context';
import { CHAT_VIEWTYPE } from 'src/constants';
import CopilotPlugin, {CopilotSettings} from 'src/main';
import { AppContext } from '@/context';
import { CHAT_VIEWTYPE } from '@/constants';
import CopilotPlugin, {CopilotSettings} from '@/main';
export default class CopilotView extends ItemView {

View file

@ -1,6 +1,6 @@
import * as React from 'react';
import { App } from 'obsidian';
import { SharedState } from 'src/sharedState';
import SharedState from '@/sharedState';
// App context
export const AppContext = React.createContext<App | undefined>(undefined);

View file

@ -1,7 +1,7 @@
import * as React from 'react';
import { App } from 'obsidian';
import { AppContext, SharedStateContext } from 'src/context';
import { SharedState } from 'src/sharedState';
import { AppContext, SharedStateContext } from '@/context';
import SharedState from '@/sharedState';
// Custom hook to use the App context
export const useApp = (): App | undefined => {

View file

@ -1,6 +1,9 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"inlineSourceMap": true,
"inlineSources": true,
"module": "ESNext",