mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 12:57:06 +02:00
EDITOR: Provide type definitions for React and ReactDOM in in-game editor. (#1458)
* Fix the type declaration of `!!raw-loader!` modules. Instead of declaring them to export an object with a single key `default` which is a string, the modules have a default export, which is a string. Note, that this doesn't actually change the generated code, just the types that typescript sees. The code worked before because the only thing done to the values was to coerce the values to a string, which turned into a no-op. * Switch from using `raw-loader` to using a source asset module. `raw-loader` was deprecated in webpack v5.
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
import index from "!!raw-loader!./doc/index.md";
|
||||
import Root from "./doc/index.md?raw";
|
||||
import { AllPages } from "./pages";
|
||||
|
||||
export type Document = typeof index;
|
||||
|
||||
export const Root = {
|
||||
content: index,
|
||||
};
|
||||
export type Document = typeof Root;
|
||||
|
||||
export const getPage = (title: string): Document => AllPages[title] ?? Root;
|
||||
|
||||
Reference in New Issue
Block a user