rspress-plugin-devkit
Version:
Rspress plugin develop kit.
24 lines (23 loc) • 719 B
JavaScript
import { uniqArray } from '../Utils/uniqArray';
export class RemarkPluginFactoryBase {
constructor(baseOptions) {
this.baseOptions = baseOptions;
}
get mdxComponents() {
return uniqArray(this.baseOptions.components.map(({ componentPath }) => componentPath));
}
get builderConfig() {
return {
tools: {
bundlerChain(chain) {
chain.module
.rule('Raw')
.resourceQuery(/raw/)
.type('asset/source')
.end();
chain.resolve.extensions.prepend('.md').prepend('.mdx');
},
},
};
}
}