UNPKG

@nxext/stencil

Version:

Nx plugin for stenciljs

34 lines 1.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addCypress = addCypress; const tslib_1 = require("tslib"); const devkit_1 = require("@nx/devkit"); function addCypress(tree, options) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (options.e2eTestRunner !== 'cypress') { return () => { }; // eslint-disable-line @typescript-eslint/no-empty-function } const { webStaticServeGenerator } = (0, devkit_1.ensurePackage)('@nx/web', devkit_1.NX_VERSION); yield webStaticServeGenerator(tree, { buildTarget: `${options.projectName}:build`, targetName: 'serve-static', spa: true, }); const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', devkit_1.NX_VERSION); (0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, { projectType: 'application', root: options.e2eProjectRoot, sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'), targets: {}, implicitDependencies: [options.projectName], tags: [], }); return yield configurationGenerator(tree, Object.assign(Object.assign({}, options), { project: options.e2eProjectName, directory: 'src', // the name and root are already normalized, instruct the generator to use them as is bundler: 'webpack', skipFormat: true, devServerTarget: `${options.projectName}:${options.e2eWebServerTarget}`, baseUrl: options.e2eWebServerAddress, jsx: true, rootProject: false, webServerCommands: { default: `nx run ${options.projectName}:${options.e2eWebServerTarget}`, production: `nx run ${options.projectName}:preview`, }, ciWebServerCommand: `nx run ${options.projectName}:serve-static` })); }); } //# sourceMappingURL=add-cypress.js.map