Skip to content

Commit

Permalink
Step 3.5: Update webpack config to handle api code
Browse files Browse the repository at this point in the history
  • Loading branch information
DAB0mB authored and Dotan Simha committed Nov 22, 2016
1 parent fdba2f7 commit 1ac7f30
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions webpack.config.js
Expand Up @@ -33,16 +33,28 @@ module.exports = {
resolve: {
extensions: ['', '.js'],
alias: {
lib: __dirname + '/www/lib'
lib: __dirname + '/www/lib',
api: __dirname + '/api/server'
}
}
};

function resolveExternals(context, request, callback) {
return cordovaPlugin(request, callback) ||
return meteorPack(request, callback) ||
cordovaPlugin(request, callback) ||
callback();
}

function meteorPack(request, callback) {
var match = request.match(/^meteor\/(.+)$/);
var pack = match && match[1];

if (pack) {
callback(null, 'Package["' + pack + '"]' );
return true;
}
}

function cordovaPlugin(request, callback) {
var match = request.match(/^cordova\/(.+)$/);
var plugin = match && match[1];
Expand Down

0 comments on commit 1ac7f30

Please sign in to comment.