Skip to content

Commit

Permalink
Add TextEncoder to commonjs exports
Browse files Browse the repository at this point in the history
  • Loading branch information
dresha-dev committed Mar 18, 2020
1 parent eede61a commit f19eea1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export default inputs.map(input => {
],
plugins: [
resolve({ mainFields: ['main'] }),
commonJS(),
commonJS({
namedExports: {
fastestsmallesttextencoderdecoder: ['TextEncoder']
}
}),
alias({
resolve: ['.js', '.json'],
core: path.resolve(srcDir, 'core'),
Expand Down
4 changes: 1 addition & 3 deletions src/core/digest.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
*/
import _ from 'lodash';
import 'webcrypto-shim';
import TextEncoderPolyfill from 'fastestsmallesttextencoderdecoder';

const { TextEncoder } = TextEncoderPolyfill;
import { TextEncoder } from 'fastestsmallesttextencoderdecoder';

//get the native implementation of the CryptoSubtle
var subtle = window.crypto.subtle || window.crypto.webkitSubtle;
Expand Down

0 comments on commit f19eea1

Please sign in to comment.