Ignore js sourcemap files from boot
This commit is contained in:
parent
cdab45d40e
commit
3d3609defe
|
@ -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',
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue