File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
packages/storybook/src/generators/configuration Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {
23
23
configureTsSolutionConfig ,
24
24
createProjectStorybookDir ,
25
25
createStorybookTsconfigFile ,
26
+ editTsconfigBaseJson ,
26
27
getE2EProjectName ,
27
28
getViteConfigFilePath ,
28
29
projectIsRootProjectInStandaloneWorkspace ,
@@ -128,6 +129,7 @@ export async function configurationGenerator(
128
129
) ;
129
130
}
130
131
configureTsProjectConfig ( tree , schema ) ;
132
+ editTsconfigBaseJson ( tree ) ;
131
133
configureTsSolutionConfig ( tree , schema ) ;
132
134
updateLintConfig ( tree , schema ) ;
133
135
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import {
28
28
import { StorybookConfigureSchema } from '../schema' ;
29
29
import { UiFramework7 } from '../../../utils/models' ;
30
30
import { nxVersion } from '../../../utils/versions' ;
31
+ import ts = require( 'typescript' ) ;
31
32
32
33
const DEFAULT_PORT = 4400 ;
33
34
@@ -259,6 +260,23 @@ export function createStorybookTsconfigFile(
259
260
writeJson ( tree , storybookTsConfigPath , storybookTsConfig ) ;
260
261
}
261
262
263
+ export function editTsconfigBaseJson ( tree : Tree ) {
264
+ let tsconfigBasePath = 'tsconfig.base.json' ;
265
+
266
+ // standalone workspace maybe
267
+ if ( ! tree . exists ( tsconfigBasePath ) ) tsconfigBasePath = 'tsconfig.json' ;
268
+
269
+ if ( ! tree . exists ( tsconfigBasePath ) ) return ;
270
+
271
+ const tsconfigBaseContent = readJson < TsConfig > ( tree , tsconfigBasePath ) ;
272
+
273
+ if ( ! tsconfigBaseContent . compilerOptions )
274
+ tsconfigBaseContent . compilerOptions = { } ;
275
+ tsconfigBaseContent . compilerOptions . skipLibCheck = true ;
276
+
277
+ writeJson ( tree , tsconfigBasePath , tsconfigBaseContent ) ;
278
+ }
279
+
262
280
export function configureTsProjectConfig (
263
281
tree : Tree ,
264
282
schema : StorybookConfigureSchema
You can’t perform that action at this time.
0 commit comments