Add info for production building
This commit is contained in:
parent
4f4af756d3
commit
a1b8013b6b
15
server.js
15
server.js
|
@ -17,7 +17,7 @@ const resolve = require( "rollup-plugin-node-resolve" );
|
||||||
const path = ( ...parts ) => join( __dirname, ...parts );
|
const path = ( ...parts ) => join( __dirname, ...parts );
|
||||||
const pp = p => // pretty-path
|
const pp = p => // pretty-path
|
||||||
( Array.isArray( p ) ? p.join( ", " ) : p )
|
( Array.isArray( p ) ? p.join( ", " ) : p )
|
||||||
.replace( __dirname, "" )
|
.replace( process.cwd(), "" )
|
||||||
.replace( /\\/g, "/" )
|
.replace( /\\/g, "/" )
|
||||||
.replace( /^\//, "" );
|
.replace( /^\//, "" );
|
||||||
|
|
||||||
|
@ -191,8 +191,21 @@ babelOptions.runtimeHelpers = true;
|
||||||
|
|
||||||
if ( NODE_ENV === "production" ) {
|
if ( NODE_ENV === "production" ) {
|
||||||
|
|
||||||
|
const output = config.output;
|
||||||
|
|
||||||
rollup
|
rollup
|
||||||
.rollup( config )
|
.rollup( config )
|
||||||
|
.then( bundle => {
|
||||||
|
|
||||||
|
console.info( `pegjs-website > bundling ${ pp( config.input ) }` );
|
||||||
|
return bundle.write( output );
|
||||||
|
|
||||||
|
} )
|
||||||
|
.then( () => {
|
||||||
|
|
||||||
|
console.info( `pegjs-website > created ${ pp( output.file ) }` );
|
||||||
|
|
||||||
|
} )
|
||||||
.catch( handleError );
|
.catch( handleError );
|
||||||
|
|
||||||
return void 0;
|
return void 0;
|
||||||
|
|
Loading…
Reference in a new issue