Add ~
as an import alias
This commit is contained in:
parent
50e7126c82
commit
6069b51f8b
6 changed files with 8 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import { ErrorRenderer } from "/components/ErrorRenderer";
|
||||
import { ResponseRenderer } from "/components/ResponseRenderer";
|
||||
import { useWebService } from "/hooks/useWebService";
|
||||
import { ErrorRenderer } from "~/components/ErrorRenderer";
|
||||
import { ResponseRenderer } from "~/components/ResponseRenderer";
|
||||
import { useWebService } from "~/hooks/useWebService";
|
||||
|
||||
export function App() {
|
||||
const [response, error] = useWebService();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import { TResponse } from "/lib/response";
|
||||
import { TResponse } from "~/lib/response";
|
||||
|
||||
export function ResponseRenderer({ response }: {response: TResponse}) {
|
||||
const t = chrome.i18n.getMessage;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TResponse, Response } from "/lib/response";
|
||||
import { useEffect, useState } from "react";
|
||||
import { TResponse, Response } from "~/lib/response";
|
||||
|
||||
type Maybe<T> = T | null;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { App } from "/components/App";
|
||||
import { App } from "~/components/App";
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const el: HTMLElement = document.getElementById("root")!;
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
"lib": [ "ES2020", "DOM" ],
|
||||
|
||||
"baseUrl": "src/",
|
||||
"paths": { "*": ["js/*"] },
|
||||
"paths": { "~/*": ["js/*"] },
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ module.exports = {
|
|||
path: path.resolve(__dirname, 'build')
|
||||
},
|
||||
resolve: {
|
||||
alias: { '~': [path.resolve('src/js/')] },
|
||||
roots: [path.resolve('src/js'), path.resolve('node_modules')],
|
||||
modules: [path.resolve('src/js'), path.resolve('node_modules')],
|
||||
extensions: ['.ts', '.tsx']
|
||||
|
|
Loading…
Reference in a new issue