refactor(v2): legacy export = syntax (#2948)

This commit is contained in:
Sébastien Lorber 2020-06-16 19:55:14 +02:00 committed by GitHub
parent 955e656496
commit 025ac4e28c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 7 deletions

View file

@ -9,9 +9,11 @@ import {getOptions} from 'loader-utils';
import {loader} from 'webpack';
import linkify from './linkify';
export = function (fileString: string) {
const markdownLoader: loader.Loader = function (source) {
const fileString = source as string;
const callback = this.async();
const {docsDir, siteDir, versionedDir, sourceToPermalink} = getOptions(this);
return (
callback &&
callback(
@ -26,4 +28,6 @@ export = function (fileString: string) {
),
)
);
} as loader.Loader;
};
export default markdownLoader;