From 3a2f9b6e15668837ec6e8306075b6b24da82a53a Mon Sep 17 00:00:00 2001 From: Permutator Date: Sat, 11 Jun 2016 21:42:15 -0700 Subject: [PATCH] Don't use endsWith. Will this fix the 0.12 build? --- test/sourcemaps/loaders/_config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sourcemaps/loaders/_config.js b/test/sourcemaps/loaders/_config.js index 2127639..8665133 100644 --- a/test/sourcemaps/loaders/_config.js +++ b/test/sourcemaps/loaders/_config.js @@ -10,9 +10,9 @@ module.exports = { plugins: [ { load: function ( id ) { - if ( id.endsWith( 'foo.js' ) ) { + if ( /foo.js$/.test( id ) ) { id = id.replace( /foo.js$/, 'bar.js' ); - } else if ( id.endsWith( 'bar.js' ) ) { + } else if ( /bar.js$/.test( id ) ) { id = id.replace( /bar.js$/, 'foo.js' ); } @@ -22,7 +22,7 @@ module.exports = { comments: false // misalign the columns }); - if ( id.endsWith( 'main.js' ) ) { + if ( /main.js$/.test( id ) ) { delete out.map.sources; } else { const slash = out.map.sources[0].lastIndexOf( '/' ) + 1;