File tree Expand file tree Collapse file tree 5 files changed +11
-40
lines changed Expand file tree Collapse file tree 5 files changed +11
-40
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,9 @@ function generateHTML(fileName) {
3434 } ) ;
3535}
3636
37- export default function BuildDocs ( { useCache , dev} ) {
37+ export default function BuildDocs ( { dev} ) {
3838 console . log ( 'Building: ' . cyan + 'docs' . green + ( dev ? ' [DEV]' . grey : '' ) ) ;
3939
40- const useCacheOption = `--use-cache=${ Boolean ( useCache ) } ` ;
4140 const devOption = dev ? '' : '-p' ;
4241
4342 return exec ( `rimraf ${ docsBuilt } ` )
@@ -46,7 +45,7 @@ export default function BuildDocs({useCache, dev}) {
4645 let pagesGenerators = Root . getPages ( ) . map ( generateHTML ) ;
4746
4847 return Promise . all ( pagesGenerators . concat ( [
49- exec ( `webpack --config webpack.docs.js ${ useCacheOption } --bail ${ devOption } ` ) ,
48+ exec ( `webpack --config webpack.docs.js --bail ${ devOption } ` ) ,
5049 copy ( license , docsBuilt ) ,
5150 copy ( readmeSrc , readmeDest )
5251 ] ) ) ;
Original file line number Diff line number Diff line change @@ -14,12 +14,6 @@ const argv = yargs
1414 demand : false ,
1515 default : false
1616 } )
17- . option ( 'use-cache' , {
18- type : 'boolean' ,
19- demand : false ,
20- default : true ,
21- describe : 'Use Babel cache when running webpack'
22- } )
2317 . option ( 'lib-only' , {
2418 demand : false ,
2519 default : false ,
Original file line number Diff line number Diff line change @@ -6,22 +6,21 @@ import { copy } from './fs-utils';
66import { distRoot , bowerRoot } from './constants' ;
77import { exec } from './exec' ;
88
9- function forkAndBuildDocs ( { verbose, useCache } ) {
9+ function forkAndBuildDocs ( { verbose} ) {
1010 console . log ( 'Building: ' . cyan + 'docs' . green ) ;
1111
1212 const verboseOption = verbose ? '--verbose' : '' ;
13- const useCacheOption = `--use-cache=${ Boolean ( useCache ) } ` ;
1413
15- return exec ( `npm run docs-build -- ${ verboseOption } ${ useCacheOption } ` )
14+ return exec ( `npm run docs-build -- ${ verboseOption } ` )
1615 . then ( ( ) => console . log ( 'Built: ' . cyan + 'docs' . green ) ) ;
1716}
1817
19- export default function Build ( { verbose , useCache } = { } ) {
18+ export default function Build ( options ) {
2019 return Promise . all ( [
2120 lib ( ) ,
2221 bower ( ) ,
23- dist ( { useCache } ) ,
24- forkAndBuildDocs ( { verbose , useCache } )
22+ dist ( ) ,
23+ forkAndBuildDocs ( options )
2524 ] )
2625 . then ( ( ) => copy ( distRoot , bowerRoot ) ) ;
2726}
Original file line number Diff line number Diff line change 11import { exec } from '../exec' ;
22import { distRoot } from '../constants' ;
33
4- export default function BuildDistributable ( { useCache } ) {
4+ export default function BuildDistributable ( ) {
55 console . log ( 'Building: ' . cyan + 'distributable' . green ) ;
66
7- const useCacheOption = `--use-cache=${ Boolean ( useCache ) } ` ;
8-
97 return exec ( `rimraf ${ distRoot } ` )
108 . then ( ( ) => Promise . all ( [
11- exec ( `webpack ${ useCacheOption } --bail` ) ,
12- exec ( `webpack ${ useCacheOption } --bail -p` )
9+ exec ( `webpack --bail` ) ,
10+ exec ( `webpack --bail -p` )
1311 ] ) )
1412 . then ( ( ) => console . log ( 'Built: ' . cyan + 'distributable' . green ) ) ;
1513}
Original file line number Diff line number Diff line change @@ -6,32 +6,13 @@ import yargs from 'yargs';
66export const options = yargs
77 . alias ( 'p' , 'optimize-minimize' )
88 . alias ( 'd' , 'debug' )
9- . option ( 'use-cache' , {
10- type : 'boolean' ,
11- default : true
12- } )
139 . option ( 'port' , {
1410 default : '8080' ,
1511 type : 'string'
1612 } )
1713 . argv ;
1814
19- export let jsLoader = 'babel' ;
20- if ( options . useCache ) {
21- const babelCache = path . resolve ( path . join ( __dirname , '../.babel-cache' ) ) ;
22-
23- if ( ! fs . existsSync ( babelCache ) ) {
24- try {
25- fs . mkdirSync ( babelCache ) ;
26- } catch ( err ) {
27- if ( err . code !== 'EEXIST' ) {
28- console . error ( err . stack ) ;
29- }
30- }
31- }
32-
33- jsLoader += `?cacheDirectory=${ babelCache } ` ;
34- }
15+ export const jsLoader = 'babel?cacheDirectory' ;
3516
3617const baseConfig = {
3718 entry : undefined ,
You can’t perform that action at this time.
0 commit comments