Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function builtinsResolver(opts: NodePolyfillsOptions) {

return (importee: string) => {
if (importee && importee.slice(-1) === '/') {
importee === importee.slice(0, -1);
importee = importee.slice(0, -1);
}
if (libs.has(importee)) {
return {id: libs.get(importee), moduleSideEffects: false};
Expand Down
7 changes: 7 additions & 0 deletions test/examples/buffer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Buffer } from 'buffer/'

if (Buffer.from('abc').length == 3) {
done();
} else {
done(new Error('Loading Buffer with a trailing /'));
}
3 changes: 2 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const files = [
'string-decoder.js',
'zlib.js',
'domain.js',
'crypto.js'
'crypto.js',
'buffer.js'
];

describe('rollup-plugin-node-polyfills', () => {
Expand Down