Skip to content

Commit

Permalink
Desktop: Stop loading desktop lib in web context
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Apr 21, 2017
1 parent 18069e9 commit 3250517
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ if ( calypsoEnv === 'production' ) {
) );
}

if ( ! config.isEnabled( 'desktop' ) ) {
webpackConfig.plugins.push( new webpack.NormalModuleReplacementPlugin( /^lib\/desktop$/, 'lodash/noop' ) );
}

if ( config.isEnabled( 'webpack/persistent-caching' ) ) {
webpackConfig.recordsPath = path.join( __dirname, '.webpack-cache', 'client-records.json' );
webpackConfig.plugins.unshift( new HardSourceWebpackPlugin( { cacheDirectory: path.join( __dirname, '.webpack-cache', 'client' ) } ) );
Expand Down
4 changes: 4 additions & 0 deletions webpack.config.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ const webpackConfig = {
externals: getExternals()
};

if ( ! config.isEnabled( 'desktop' ) ) {
webpackConfig.plugins.push( new webpack.NormalModuleReplacementPlugin( /^lib\/desktop$/, 'lodash/noop' ) );
}

if ( config.isEnabled( 'webpack/persistent-caching' ) ) {
webpackConfig.recordsPath = path.join( __dirname, '.webpack-cache', 'server-records.json' );
webpackConfig.plugins.unshift( new HardSourceWebpackPlugin( { cacheDirectory: path.join( __dirname, '.webpack-cache', 'server' ) } ) );
Expand Down

0 comments on commit 3250517

Please sign in to comment.