UNPKG

595 BJavaScriptView Raw
1import fs from 'fs';
2
3const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
4
5const greenwoodThemeStarterPresentation = (options = {}) => [{
6 type: 'context',
7 name: `${packageJson.name}:context`,
8 provider: (compilation) => {
9 const templateLocation = options.__isDevelopment // eslint-disable-line no-underscore-dangle
10 ? new URL('./layouts/', compilation.context.userWorkspace)
11 : new URL('./dist/layouts/', import.meta.url);
12
13 return {
14 templates: [
15 templateLocation
16 ]
17 };
18 }
19}];
20
21export {
22 greenwoodThemeStarterPresentation
23};
\No newline at end of file