Browse Source

Don't use endsWith. Will this fix the 0.12 build?

ghi-672
Permutator 9 years ago
parent
commit
3a2f9b6e15
No known key found for this signature in database GPG Key ID: 763F7A2F18CAB33E
  1. 6
      test/sourcemaps/loaders/_config.js

6
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;

Loading…
Cancel
Save