Open NorthSeacoder opened 3 years ago
vite.config.js配置
import { createVuePlugin } from "vite-plugin-vue2";
.....
plugins: [
createVuePlugin({
jsx: true,
}),
legacyPlugin({
targets: [
"Android > 39",
"Chrome >= 60",
"Safari >= 10.1",
"iOS >= 10.3",
"Firefox >= 54",
"Edge >= 15"
]
}),
viteMockServe({
mockPath: "mock",
localEnabled: command === "serve"
}),
viteExternalsPlugin({
jquery: "jQuery"
}),
svgLoader()
],
运行后的vite错误
> src/base/app.js:28:8: error: Unexpected "<"
28 │ <div class="frame-app">
╵ ^
> src/common/cet-scroller/index.js:73:6: error: Unexpected "<"
73 │ <div
╵ ^
error when starting dev server:
Error: Build failed with 2 errors:
src/base/app.js:28:8: error: Unexpected "<"
src/common/cet-scroller/index.js:73:6: error: Unexpected "<"
at failureErrorWithLog (C:\Users\dell\Desktop\test\CliV3.0\node_modules\esbuild\lib\main.js:1493:15)
at C:\Users\dell\Desktop\test\CliV3.0\node_modules\esbuild\lib\main.js:1151:28
at runOnEndCallbacks (C:\Users\dell\Desktop\test\CliV3.0\node_modules\esbuild\lib\main.js:941:63)
at buildResponseToResult (C:\Users\dell\Desktop\test\CliV3.0\node_modules\esbuild\lib\main.js:1149:7)
at C:\Users\dell\Desktop\test\CliV3.0\node_modules\esbuild\lib\main.js:1258:14
at C:\Users\dell\Desktop\test\CliV3.0\node_modules\esbuild\lib\main.js:629:9
at handleIncomingPacket (C:\Users\dell\Desktop\test\CliV3.0\node_modules\esbuild\lib\main.js:726:9)
at Socket.readFromStdout (C:\Users\dell\Desktop\test\CliV3.0\node_modules\esbuild\lib\main.js:596:7)
at Socket.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:265:9)
at Socket.Readable.push (internal/streams/readable.js:204:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
app.js内容
...
render() {
return (
<div class="frame-app">
<FrameContainer />
<FramePopup popup={this.popup} />
</div>
);
},
...
配置jsx还是运行了会显示这个错误
vite.config.js
.vue
errors