Ignore js sourcemap files from boot

This commit is contained in:
Zak Barbuto 2017-09-14 09:20:15 +09:30
parent cdab45d40e
commit 3d3609defe
2 changed files with 24 additions and 0 deletions

View File

@ -661,6 +661,12 @@ function resolveRelativePaths(relativePaths, appRootDir) {
function getExcludedExtensions() {
return {
'.json': '.json',
/**
* 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',
'.node': 'node',
};
}

View File

@ -2187,6 +2187,24 @@ describe('compiler', function() {
'sourceFile', coffee);
});
it('ignores sourcmap files when loading middleware',
function() {
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': {},
},
});
var instructions = boot.compile(appdir.PATH);
expect(instructions.middleware.middleware[0]).have.property(
'sourceFile', middleware);
});
describe('config with relative paths in params', function() {
var RELATIVE_PATH_PARAMS = [
'$!./here',