Merge pull request #264 from NextFaze/fix/ignore-maps-3
Ignore source maps in boot
This commit is contained in:
commit
6e7809d3ef
|
@ -102,6 +102,12 @@ function getExcludedExtensions() {
|
||||||
return {
|
return {
|
||||||
'.json': '.json',
|
'.json': '.json',
|
||||||
'.node': 'node',
|
'.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',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
describe('config with relative paths in params', function() {
|
||||||
var RELATIVE_PATH_PARAMS = [
|
var RELATIVE_PATH_PARAMS = [
|
||||||
'$!./here',
|
'$!./here',
|
||||||
|
|
Loading…
Reference in New Issue