Feat: Vite + React (#991)
* remove test_web * integrate reactjs-vite * update lint-staged * simple cors proxy server which handles cookies and redirections * overrider global fetch with proxy call * simple examples for set cookies and fetch request * app bar * add redux * loadPlugins. error: cant load urlencode module * add ts-node for transforming * plugin search & select * plugin slice * accordion components * path item & popular novel * optional for filters * search novel * parse novel * parseChapter * update cookies * default filters * fix: import path * bundler module resolution * new json_plugins * fix: generate multisrc (missing filters) * fix: host scripts * fix: plugin code path * remove typechecking action
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import '@fontsource/roboto/300.css';
|
||||
import '@fontsource/roboto/400.css';
|
||||
import '@fontsource/roboto/500.css';
|
||||
import '@fontsource/roboto/700.css';
|
||||
import 'cheerio';
|
||||
import 'htmlparser2';
|
||||
import 'dayjs';
|
||||
import 'qs';
|
||||
import 'protobufjs';
|
||||
|
||||
const { fetch: originalFetch } = window;
|
||||
window.fetch = async (...args) => {
|
||||
let [resource, config] = args;
|
||||
if (resource.toString().includes('localhost')) {
|
||||
const response = await originalFetch(resource, config);
|
||||
return response;
|
||||
}
|
||||
const response = await originalFetch('http://localhost:3001/' + resource, {
|
||||
...config,
|
||||
credentials: 'include',
|
||||
mode: 'cors',
|
||||
});
|
||||
return response;
|
||||
};
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
);
|
||||
Reference in New Issue
Block a user