@@ -8,14 +8,14 @@ import { globalState } from '../../utils/global-state';
88import { prettierConfig } from '../../utils/prettier-config' ;
99import { ProjectConfig } from '../../utils/project-config-interface' ;
1010import {
11+ componentEntry ,
1112 declarePath ,
1213 docsPath ,
1314 gitIgnores ,
1415 npmIgnores ,
1516 pagesPath ,
1617 srcPath ,
17- tempTypesPath ,
18- tsBuiltPath
18+ tempTypesPath
1919} from '../../utils/structor-config' ;
2020
2121export function ensureDeclares ( projectRootPath : string ) {
@@ -43,21 +43,19 @@ export const ensureTsconfig = () => ({
4343 target : 'esnext' ,
4444 experimentalDecorators : true ,
4545 skipLibCheck : true ,
46- outDir : tsBuiltPath . dir ,
47- rootDir : './' , // Make sure ./src structor. # https://github.com/Microsoft/TypeScript/issues/5134
46+ outDir : globalState . projectConfig . distDir ,
47+ rootDir : './' ,
4848 baseUrl : '.' ,
4949 lib : [ 'dom' , 'es5' , 'es6' , 'scripthost' ] ,
50- paths : {
51- [ PRI_PACKAGE_NAME + '/*' ] : [ PRI_PACKAGE_NAME , path . join ( tempTypesPath . dir , '*' ) ]
52- }
50+ paths : { [ PRI_PACKAGE_NAME + '/*' ] : [ PRI_PACKAGE_NAME , path . join ( tempTypesPath . dir , '*' ) ] }
5351 } ,
5452 include : [ '.temp/**/*' , 'src/**/*' , 'config/**/*' , 'tests/**/*' ] ,
55- exclude : [ 'node_modules' , tsBuiltPath . dir ]
53+ exclude : [ 'node_modules' , globalState . projectConfig . distDir ]
5654 } ,
5755 null ,
5856 2
5957 ) + '\n'
60- ) ;
58+ ) ; // Make sure ./src structor. # https://github.com/Microsoft/TypeScript/issues/5134
6159 }
6260} ) ;
6361
@@ -123,6 +121,7 @@ export const ensurePackageJson = () => ({
123121 start : 'pri dev' ,
124122 docs : 'pri docs' ,
125123 build : 'pri build' ,
124+ bundle : 'pri bundle' ,
126125 preview : 'pri preview' ,
127126 analyse : 'pri analyse' ,
128127 test : 'pri test' ,
@@ -227,7 +226,7 @@ export default async (instance: typeof pri) => {
227226 JSON . stringify (
228227 _ . merge ( { } , prevJson , {
229228 main : `${ instance . projectConfig . distDir } /${ srcPath . dir } /index.js` ,
230- types : ` ${ srcPath . dir } /index.tsx` ,
229+ types : path . format ( componentEntry ) ,
231230 peerDependencies : {
232231 react : '>=16.0.0' ,
233232 'react-dom' : '>=16.0.0'
@@ -248,7 +247,7 @@ export default async (instance: typeof pri) => {
248247
249248 // Create entry file
250249 instance . project . addProjectFiles ( {
251- fileName : ` ${ srcPath . dir } /index.tsx` ,
250+ fileName : path . format ( componentEntry ) ,
252251 pipeContent : text =>
253252 text
254253 ? text
0 commit comments