javascript - babel-loader 错误 意外的令牌,应为“/<=/>=”
问题描述
与预设错误不同。我收到结束标签的错误。
我无法创建构建
我不得不使用“@babel/plugin-transform-typescript”来解决现有问题。我在哪里使用错误
{ customer_name, avatar, customerUUID }: row
作为函数参数
控制台错误 bable.config 文件
module.exports = {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-destructuring",
"@babel/plugin-transform-typescript",
"@babel/plugin-transform-react-inline-elements",
// "@babel/plugin-proposal-export-default-from",
// "@babel/plugin-proposal-optional-chaining",
// "@babel/plugin-syntax-dynamic-import",
// "@babel/plugin-transform-regenerator",
// "@babel/plugin-transform-runtime",
],
};
这是我的 webpack.config 文件
const path = require("path");
module.exports = {
entry: path.resolve(__dirname, "./src/index.js"),
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: "babel-loader",
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
},
{
test: /\.svg$/,
loader: 'svg-inline-loader'
},
{
test: /\.(png|jpe?g|gif)$/i,
use: [
{
loader: 'file-loader',
},
],
},
],
},
output: {
filename: "bundle.js",
},
};
解决方案
推荐阅读
- asterisk - 当我在 Asterisk 中拨打任何分机时,首先播放一些问候消息?
- c++ - 对话关闭信号
- capacitor - 无法在 Capacitor Ionic 的应用程序视图中打开 PDF 文件
- wpf - 将带有数据库的 wpf 应用程序提供给客户端
- javascript - V8 可以执行 JS 代码的构建时预编译吗?
- c++ - QtCharts:如何用误差线绘制线系列
- node.js - 安装 npm 和 vue 后“npm run hot”抛出错误
- angular - 错误:InvalidPipeArgument:管道“AsyncPipe”MatTable Angular 11 的“[object Object]”
- dataframe - 从过滤聚合pySpark中获取第一个示例元素
- python - P4Python 删除客户端/工作区的问题