@nxext/stencil
Version:
Nx plugin for stenciljs
23 lines • 1.16 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateStencilSourceOptions = calculateStencilSourceOptions;
const devkit_1 = require("@nx/devkit");
const common_1 = require("@nxext/common");
const generator_1 = require("../../storybook-configuration/generator");
function calculateStencilSourceOptions(host, projectName) {
const stencilProjectConfig = (0, devkit_1.readProjectConfiguration)(host, projectName);
const stencilConfigPath = `${stencilProjectConfig.root}/stencil.config.ts`;
const stencilConfigSource = (0, common_1.readTsSourceFile)(host, stencilConfigPath);
// Same derivation as `getProjectTsImportPath` (Design 2.5): prefer the
// project's real package.json name (its actual importPath) over the
// npmScope-based guess, which only matches by coincidence when nobody
// passed an explicit `--importPath`.
const packageName = (0, generator_1.getProjectTsImportPath)(host, projectName);
return {
stencilProjectConfig,
stencilConfigPath,
stencilConfigSource,
packageName,
};
}
//# sourceMappingURL=calculate-stencil-source-options.js.map