reactjs - Meteor - webpack 和 ecmascript 都在尝试处理 *.jsx
问题描述
所以我试图在 Meteor 中安装和使用react-wavesurfer,它是现有 js 库(wavesurfer.js)的反应组件包装器。它要求将 wavesurfer.js 文件(必须单独安装)作为全局变量提供。
建议为此使用 webpack,如下所示:
// provide WaveSurfer as a globally accessible variable
plugins: [
new webpack.ProvidePlugin({
WaveSurfer: 'wavesurfer.js'
})
],
// Alias `wavesurfer` to the correct wavesurfer package.
// (wavesurfer.js has some non-standard naming convention)
resolve: {
alias: {
wavesurfer: require.resolve('wavesurfer.js')
}
},
我从未使用过 Webpack(不完全确定它的作用),而且我是 Meteor / React 新手。
所以我安装了:
meteor add webpack:webpack
现在我在控制台中收到以下错误:
While determining active plugins:
error: conflict: two packages included in the app (webpack:webpack and ecmascript) are both trying to handle *.js
error: conflict: two packages included in the app (webpack:webpack and ecmascript) are both trying to handle *.jsx
从错误中我假设ecmascript
(再次我一无所知)正在做与 webpack 类似的工作,这导致了冲突?
所以,我的问题......我该如何设置ecmascript
呢?我真的不知道!
解决方案
尝试使用我仍然维护的新包 https://github.com/ardatan/meteor-webpack
推荐阅读
- reactjs - 如何从另一个使用 socket.io 从服务器发回的 ReactJS 文件返回数据
- java - 在 Scala 中的方法中获取抽象错误
- php - 如何使用 php 将适配器上的字符串解析到数据库
- angular - Angular 6 如何定义两个 url HTTP request 404 not found
- php - preg 用点分隔符替换数字
- python - pyMongo 删除/修改找到的文件
- c - CS50 pset5 哈希表节点
- webrtc - ICE 中继候选人是否根据延迟进行优先级排序?
- javascript - 当父级可调整大小时,如何防止嵌套 DIV 的内容溢出父级?
- c# - log4net 如何在应用服务器上工作