UNPKG

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