mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 06:27:02 +02:00
refactor: migrate lqip-loader to TS, fix typing for Webpack Loaders (#5779)
This commit is contained in:
parent
ca5d70d7fb
commit
68c970175a
18 changed files with 254 additions and 265 deletions
|
@ -5,13 +5,12 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// TODO temporary until Webpack5 export this type
|
||||
// see https://github.com/webpack/webpack/issues/11630
|
||||
interface Loader extends Function {
|
||||
(this: any, source: string): string | Buffer | void | undefined;
|
||||
}
|
||||
import type {LoaderContext} from 'webpack';
|
||||
|
||||
const markdownLoader: Loader = function (fileString) {
|
||||
export default function markdownLoader(
|
||||
this: LoaderContext<undefined>,
|
||||
fileString: string,
|
||||
): void {
|
||||
const callback = this.async();
|
||||
|
||||
// const options = this.getOptions();
|
||||
|
@ -20,6 +19,4 @@ const markdownLoader: Loader = function (fileString) {
|
|||
// fileString = linkify(fileString)
|
||||
|
||||
return callback && callback(null, fileString);
|
||||
};
|
||||
|
||||
export default markdownLoader;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue