29 lines
745 B
TypeScript
29 lines
745 B
TypeScript
import {
|
|
readWorkspaceConfiguration,
|
|
Tree,
|
|
updateWorkspaceConfiguration,
|
|
} from '@nrwl/devkit';
|
|
|
|
import { NormalizedSchema } from './normalize-options';
|
|
|
|
export function setDefaults(host: Tree, options: NormalizedSchema) {
|
|
const workspace = readWorkspaceConfiguration(host);
|
|
|
|
workspace.generators = workspace.generators || {};
|
|
workspace.generators['@nrwl/next'] = workspace.generators['@nrwl/next'] || {};
|
|
const prev = workspace.generators['@nrwl/next'];
|
|
|
|
workspace.generators = {
|
|
...workspace.generators,
|
|
'@nrwl/next': {
|
|
...prev,
|
|
application: {
|
|
style: options.style,
|
|
linter: options.linter,
|
|
...prev.application,
|
|
},
|
|
},
|
|
};
|
|
updateWorkspaceConfiguration(host, workspace);
|
|
}
|