我正在开发一个库,在我开始进行单元测试之前,它一直运行良好。直到几天前,我可以通过以下方式实例化我的库:this.belpay = new belpay.SDK('test', { username: 'username', password: 'password', key: 'abc-def', });在我的 Chrome 控制台中:现在我出现以下错误:为了消除此错误,我不得不执行以下操作:this.belpay = new belpay.default('test', { username: 'username', password: 'password', key: 'abc-def', });我不明白为什么现在它显示我默认。我在rollup.config中一直有此设置.jsimport nodePolyfills from 'rollup-plugin-node-polyfills';import babel from 'rollup-plugin-babel';import serve from 'rollup-plugin-serve';import commonjs from '@rollup/plugin-commonjs';import livereload from 'rollup-plugin-livereload';import { terser } from 'rollup-plugin-terser';import json from 'rollup-plugin-json';export default { input: 'src/index.js', context: 'window', output: [ { file: 'dist/belpay.js', format: 'umd', name: 'belpay', exports: 'named', globals: ['axios'], }, { file: 'dist/belpay.min.js', format: 'umd', name: 'belpay', plugins: [terser()], exports: 'named', }, ], external: ['axios'], plugins: [ babel({ exclude: ['node_modules/**'], runtimeHelpers: true, }), nodePolyfills(), serve({ host: 'localhost', port: 1234, contentBase: 'dist', historyApiFallback: true, allowCrossOrigin: true, }), commonjs({ include: 'node_modules/axios/**', }), livereload({ watch: 'dist', verbose: true, }), json(), ],};
添加回答
举报
0/150
提交
取消
