nl_tokens: dev / bundle only mode
pl_tokens: function webpackDev ( app ) { var { config } = app . locals ; // configure data-source var DataSource = require ( 'loopback-datasource-juggler' ) . DataSource ; var mainDs = new DataSource ( config . db ) ; // Enable All CORS Requests app . use ( cors ( ) ) ; let sql = "SELECT * FROM zlSite WHERE zsTheme != ''" ; mainDs . connector . execute ( sql , [ null ] , function ( <mask> , zs ) { if ( err ) app . error ( err ) ; else { _ . forEach ( zs , function ( zlSite ) { // check if we're only working on 1 site if ( process . env . DEV_SITE && zlSite . zsId !== process . env . DEV_SITE ) { return ; } // webpack config specific for hot/webpackDevServer let hotConf = { output : { filename : ` ${ zlSite . zsId } ` , publicPath : '/' , path : '/' } , devtool : 'cheap-module-source-map' , plugins : [ new ExtractTextPlugin ( { filename : ` ${ zlSite . zsId } ` } ) ] } // make bundle config for site readyBundle ( app , zlSite , '' , '' , ( wpConfig ) => { var webpackConfig = merge ( common , wpConfig , hotConf ) ; var compiler = webpack ( webpackConfig ) ; app . use ( webpackDevMiddleware ( compiler , { publicPath : "/" , lazy : false } ) ) ; } ) ; } ) ; // launch webpack-dev-middleware server var port = 3000 if ( config . webpackDevServer && config . webpackDevServer . port ) { port = config . webpackDevServer . port ; } app . listen ( port , function ( ) { app . debug ( 'webpackDevMiddleware Listening on port %s!' , port ) } ) ; } } ) ; }