We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd06f1d commit c0a284dCopy full SHA for c0a284d
gatsby-node.js
@@ -1 +1,4 @@
1
-exports.sourceNodes = require(`./dist/src/main`).sourceNodes;
+const plugin = require(`./dist/src/main`);
2
+
3
+exports.onPreInit = plugin.onPreInit;
4
+exports.sourceNodes = plugin.sourceNodes;
src/gatsby/onPreInit.ts
@@ -0,0 +1,12 @@
+/**
+ * @file On pre init.
+ */
5
+import pkg from '../../package.json';
6
7
8
+ * Outputs a log on initialisation.
9
10
+export function onPreInit(): void {
11
+ console.log(`${pkg.name} @ ${pkg.version} loaded`); // tslint:disable-line:no-console
12
+}
src/main.ts
@@ -4,4 +4,5 @@
export * from './lib/definitions';
+export { onPreInit } from './gatsby/onPreInit';
export { sourceNodes } from './gatsby/sourceNodes';
0 commit comments