我试图将connectycube与Ionic-Angular结合使用。 我使用.babelrc和webpack.config配置babel,如下所示,但出现此错误:
ERROR in ./node_modules/connectycube/lib/videocalling_conference/cubeConferenceClient.js 12:21
[ng] Module parse failed: Unexpected token (12:21)
[ng] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
[ng] | }
[ng] |
[ng] > DEVICE_INPUT_TYPES = DEVICE_INPUT_TYPES
[ng] | CALL_TYPES = CALL_TYPES
[ng] |
webpack.config.js
module: {
loaders: [
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.(js|jsx)$/,
exclude: [/node_modules/],
use: ['babel-loader']
},
{
test: /\.tsx?$/,
exclude: [/node_modules/],
loader: 'babel-loader',
},
]
},
.babelrc
{
"presets": ["es2015", "@babel/preset-env"],
"plugins": [
"plugin-syntax-typescript",
"plugin-proposal-object-rest-spread",
"plugin-proposal-class-properties"
]
}