@nxext/stencil
Version:
Nx plugin for stenciljs
16 lines • 704 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateMain = updateMain;
const devkit_1 = require("@nx/devkit");
/**
* `@nx/storybook`'s generated main.ts points its stories glob at `src/lib`
* (its own convention). Stencil generators put components under
* `src/components` instead — point the glob at the right place.
*/
function updateMain(host, projectName) {
const { root } = (0, devkit_1.readProjectConfiguration)(host, projectName);
const mainPath = `${root}/.storybook/main.ts`;
const content = host.read(mainPath, 'utf-8');
host.write(mainPath, content.replace(/src\/lib/gi, 'src/components'));
}
//# sourceMappingURL=update-main.js.map