UNPKG

storybook-addon-angular-ivy

Version:

This addon enables Ivy for @storybook/angular and is meant as a preview before it gets integrated into @storybook/angular itself.

32 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.webpack = void 0; const ngcc_1 = require("@angular/compiler-cli/ngcc"); const path = require("path"); /** * Run ngcc for converting modules to ivy format before starting storybook * This step is needed in order to support Ivy in storybook * * Information about Ivy can be found here https://angular.io/guide/ivy */ ngcc_1.process({ // should be async: true but does not work due to // https://github.com/storybookjs/storybook/pull/11157/files#r615413803 async: false, basePath: path.join(process.cwd(), "node_modules"), createNewEntryPointFormats: true, compileAllFormats: false, }); const webpack = (webpackConfig, _ = {}) => { return Object.assign(Object.assign({}, webpackConfig), { resolve: Object.assign(Object.assign({}, webpackConfig.resolve), { mainFields: [ "es2015_ivy_ngcc", "module_ivy_ngcc", "main_ivy_ngcc", "es2015", "browser", "module", "main", ] }) }); }; exports.webpack = webpack; //# sourceMappingURL=index.js.map