Merge pull request #264 from NextFaze/fix/ignore-maps-3

Ignore source maps in boot
This commit is contained in:
Miroslav Bajtoš 2017-09-21 12:59:47 +02:00 committed by GitHub
commit 6e7809d3ef
2 changed files with 28 additions and 0 deletions

View File

@ -102,6 +102,12 @@ function getExcludedExtensions() {
return {
'.json': '.json',
'.node': 'node',
/**
* This is a temporary workaround for #246
* See discussion here for full description of the underlying issue
* https://github.com/strongloop/loopback-boot/pull/245#issuecomment-311052798
*/
'.map': 'map',
};
}

View File

@ -2632,6 +2632,28 @@ describe('compiler', function() {
});
});
it('ignores sourcmap files when loading middleware',
function(done) {
var middleware = appdir.writeFileSync('my-middleware.js',
'// I am the middleware');
var sourcemap = appdir.writeFileSync('my-middleware.js.map',
'// I am a sourcemap');
appdir.writeConfigFileSync('middleware.json', {
'routes': {
'./my-middleware': {},
},
});
boot.compile(appdir.PATH, function(err, context) {
if (err) return done(err);
var instructions = context.instructions;
expect(instructions.middleware.middleware[0]).have.property(
'sourceFile', middleware);
done();
});
});
describe('config with relative paths in params', function() {
var RELATIVE_PATH_PARAMS = [
'$!./here',