Remove webpack
We no longer need webpack to polyfill dynamic imports because the vast majority of browser now support ES modules and dynamic imports.
This commit is contained in:
1 parent
6cca59c666
commit
44748e5769
6 files changed
+70
-601
No files matched your search
+17
-14
@@ -28,21 +28,24 @@ const component: ClosureComponent = (): Component => {
|
||||
name: vnode.attrs["id"],
|
||||
value: vnode.attrs["value"],
|
||||
oncreate: (_vnode) => {
|
||||
const editor = codeMirror.fromTextArea(_vnode.dom, {
|
||||
mode: vnode.attrs["mode"],
|
||||
lineNumbers: true,
|
||||
readOnly: vnode.attrs["readOnly"],
|
||||
extraKeys: {
|
||||
"Ctrl-Enter": () => {
|
||||
if (vnode.attrs["onSubmit"])
|
||||
vnode.attrs["onSubmit"](_vnode.dom);
|
||||
const editor = codeMirror.fromTextArea(
|
||||
_vnode.dom as HTMLTextAreaElement,
|
||||
{
|
||||
mode: vnode.attrs["mode"],
|
||||
lineNumbers: true,
|
||||
readOnly: vnode.attrs["readOnly"],
|
||||
extraKeys: {
|
||||
"Ctrl-Enter": () => {
|
||||
if (vnode.attrs["onSubmit"])
|
||||
vnode.attrs["onSubmit"](_vnode.dom);
|
||||
},
|
||||
"Cmd-Enter": () => {
|
||||
if (vnode.attrs["onSubmit"])
|
||||
vnode.attrs["onSubmit"](_vnode.dom);
|
||||
},
|
||||
},
|
||||
"Cmd-Enter": () => {
|
||||
if (vnode.attrs["onSubmit"])
|
||||
vnode.attrs["onSubmit"](_vnode.dom);
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
if (vnode.attrs["onChange"]) {
|
||||
editor.on("change", (e) => {
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
import * as notifications from "./notifications";
|
||||
|
||||
export let codeMirror;
|
||||
export let yaml;
|
||||
export let codeMirror: typeof import("codemirror");
|
||||
export let yaml: typeof import("yaml");
|
||||
|
||||
let note;
|
||||
|
||||
@@ -43,11 +43,9 @@ export function loadCodeMirror(): Promise<void> {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const promises = [
|
||||
import(/* webpackChunkName: "codemirror" */ "codemirror"),
|
||||
import(
|
||||
/* webpackChunkName: "codemirror" */ "codemirror/mode/javascript/javascript"
|
||||
),
|
||||
import(/* webpackChunkName: "codemirror" */ "codemirror/mode/yaml/yaml"),
|
||||
import("codemirror"),
|
||||
import("codemirror/mode/javascript/javascript"),
|
||||
import("codemirror/mode/yaml/yaml"),
|
||||
];
|
||||
Promise.all(promises)
|
||||
.then((modules) => {
|
||||
@@ -65,7 +63,7 @@ export function loadYaml(): Promise<void> {
|
||||
if (yaml) return Promise.resolve();
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
import(/* webpackChunkName: "yaml" */ "yaml")
|
||||
import("yaml")
|
||||
.then((module) => {
|
||||
yaml = module;
|
||||
resolve();
|
||||
|
||||
Reference in new issue
Block a user