Skip to content

Commit

Permalink
No more require
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Oct 7, 2024
1 parent 10d52da commit 7f666e5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,3 @@ Copyright © 2015 - 2024 [Tyler Liu](https://github.com/tylerlong)
- Make an app for ebook authoring
- Rewrite markdown-core, a mono repo for all the plugins
- bug: scroll by url hash, source code position is not accurate
- issue disappeared after replacing babel with ts
- Remove all `eslint-disable`
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body,
.CodeMirror {
margin: 0;
padding: 0;
height: 100%;
height: 100% !important;
}

.ui-layout-pane {
Expand Down
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Markdown Plus</title>
<link rel="icon" type="image/svg+xml" href="icon.svg" />
<link rel="stylesheet" href="index.css" />
</head>
<body>
<div id="mdp-container" style="height: 99%">
Expand Down
8 changes: 3 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-require-imports */
import $ from 'jquery';

import markdownUrl from './sample.md';
Expand Down Expand Up @@ -31,9 +30,9 @@ $(async () => {
'https://cdn.jsdelivr.net/jquery.layout/1.4.3/jquery.layout.min.js',
);

const editor = require('./editor').default;
require('./init');
require('./preferences');
const editor = (await import('./editor')).default;
await import('./init');
await import('./preferences');
$.get(markdownUrl, (data) => {
editor.setValue(data);
setTimeout(() => {
Expand All @@ -50,5 +49,4 @@ $(async () => {
}
}, 3000);
});
require('./index.css');
});

0 comments on commit 7f666e5

Please sign in to comment.