Closed terasum closed 3 years ago
you have to install the "@babel/runtime" to resolve this:
yarn add --dev @babel/runtime
目前可用,不过这是一种”侵入式“的解决方法,侵入了该库使用者的代码。
把 @babel/runtime 依赖项放到 dependencies 而不是 devDependencies 应该可以解决?
官网的示例( https://babeljs.io/docs/en/babel-runtime )也是放到 dependencies 的
npm install --save @babel/runtime
@songxiaocheng 我理解是因为使用了 babel 7 导致有些代码需要运行时才可以使用,我们的库依赖 @babel/runtime 应该可以解决这个问题
在这里(https://github.com/terasum/js-mdict/commit/9cdc7e5dc77db90e3c7c7d009f7c667269dbefc5#r52574247 )引入了 @babel/plugin-transform-runtime
插件
其官网写到:
Install it as development dependency. and @babel/runtime as a production dependency (since it's for the "runtime"). The transformation plugin is typically used only in development, but the runtime itself will be depended on by your deployed code
PR #57 应该可以解决这个问题,close 了