docusaurus/packages/docusaurus-plugin-content-docs/src/markdown/index.ts
Yangshun Tay b07507c9cc
chore(v2): upgrade devDependencies (#2538)
* chore(v2): upgrade devDependencies

* chore(v2): upgrade devDependencies

* chore: prettier
2020-04-05 19:07:44 +08:00

29 lines
689 B
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {getOptions} from 'loader-utils';
import {loader} from 'webpack';
import linkify from './linkify';
export = function (fileString: string) {
const callback = this.async();
const {docsDir, siteDir, versionedDir, sourceToPermalink} = getOptions(this);
return (
callback &&
callback(
null,
linkify(
fileString,
this.resourcePath,
docsDir,
siteDir,
sourceToPermalink,
versionedDir,
),
)
);
} as loader.Loader;