mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-01-09 08:22:09 -05:00
31 lines
757 B
TypeScript
31 lines
757 B
TypeScript
|
import { CreateNodes } from '@nx/devkit';
|
||
|
import { dirname } from 'path';
|
||
|
|
||
|
export const createNodes: CreateNodes = [
|
||
|
'**/tsconfig.plugin.json',
|
||
|
async (configFilePath) => {
|
||
|
const projectRoot = dirname(configFilePath);
|
||
|
const projectName = projectRoot.split('/').pop();
|
||
|
|
||
|
if (!projectName) {
|
||
|
throw new Error('Could not determine project name');
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
projects: {
|
||
|
[projectRoot]: {
|
||
|
root: projectRoot,
|
||
|
targets: {
|
||
|
init: {
|
||
|
executor: 'nx:run-commands',
|
||
|
options: {
|
||
|
command: `nx run-many --parallel --targets=buildPlugin,serve --projects=${projectName} --watch`,
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
},
|
||
|
];
|