feat: init

This commit is contained in:
Morten Olsen
2022-12-06 09:12:53 +01:00
commit 3f5e941446
115 changed files with 13148 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import * as webpack from 'webpack';
import fm from 'front-matter';
function webpackLoader(
this: webpack.LoaderContext<{}>,
contents: string = ''
) {
const callback = this.async();
const run = async () => {
const { attributes, body } = fm(contents);
return {
attributes,
body,
};
};
run()
.then((content) => {
callback(null, `module.exports=${JSON.stringify(content)}`);
})
.catch((error) => {
callback(error);
});
}
export { webpackLoader };