mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
Restore old editor entrypoint
This commit is contained in:
parent
e71f789958
commit
a05f3dd38a
3 changed files with 40 additions and 2 deletions
|
@ -146,7 +146,7 @@ fn build_css(build: &mut Build) -> Result<()> {
|
|||
},
|
||||
)?;
|
||||
}
|
||||
let other_ts_css = build.inputs_with_suffix(inputs![":ts:reviewer:reviewer.css"], ".css");
|
||||
let other_ts_css = build.inputs_with_suffix(inputs![":ts:editor", ":ts:reviewer:reviewer.css"], ".css");
|
||||
build.add_action(
|
||||
"qt:aqt:data:web:css",
|
||||
CopyFiles {
|
||||
|
@ -188,7 +188,7 @@ fn build_js(build: &mut Build) -> Result<()> {
|
|||
},
|
||||
)?;
|
||||
let files_from_ts =
|
||||
build.inputs_with_suffix(inputs![":ts:reviewer:reviewer.js", ":ts:mathjax"], ".js");
|
||||
build.inputs_with_suffix(inputs![":ts:editor", ":ts:reviewer:reviewer.js", ":ts:mathjax"], ".js");
|
||||
build.add_action(
|
||||
"qt:aqt:data:web:js",
|
||||
CopyFiles {
|
||||
|
|
|
@ -29,6 +29,7 @@ pub fn build_and_check_web(build: &mut Build) -> Result<()> {
|
|||
build_sveltekit(build)?;
|
||||
declare_and_check_other_libraries(build)?;
|
||||
build_and_check_pages(build)?;
|
||||
build_and_check_editor(build)?;
|
||||
build_and_check_reviewer(build)?;
|
||||
build_and_check_mathjax(build)?;
|
||||
check_web(build)?;
|
||||
|
@ -217,6 +218,33 @@ fn build_and_check_pages(build: &mut Build) -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Only used for the legacy editor page.
|
||||
fn build_and_check_editor(build: &mut Build) -> Result<()> {
|
||||
let editor_deps = inputs![
|
||||
":ts:lib",
|
||||
":ts:components",
|
||||
":ts:domlib",
|
||||
":ts:sveltelib",
|
||||
":ts:html-filter",
|
||||
":sass",
|
||||
":sveltekit",
|
||||
glob!("ts/lib/editable,routes/{editor,image-occlusion}/**")
|
||||
];
|
||||
|
||||
build.add_action(
|
||||
"ts:editor",
|
||||
EsbuildScript {
|
||||
script: "ts/bundle_svelte.mjs".into(),
|
||||
entrypoint: "ts/routes/editor/index.ts".into(),
|
||||
output_stem: "ts/editor/editor",
|
||||
deps: editor_deps.clone(),
|
||||
extra_exts: &["css"],
|
||||
},
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn build_and_check_reviewer(build: &mut Build) -> Result<()> {
|
||||
let reviewer_deps = inputs![
|
||||
":ts:lib",
|
||||
|
|
10
ts/routes/editor/index.ts
Normal file
10
ts/routes/editor/index.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
// Copyright: Ankitects Pty Ltd and contributors
|
||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
// Entry point for the legacy editor page.
|
||||
|
||||
import { globalExport } from "@tslib/globals";
|
||||
|
||||
import * as base from "./base";
|
||||
|
||||
globalExport(base);
|
Loading…
Reference in a new issue