admin管理员组文章数量:1025227
I am trying build using vite. How can I make it not error out on packages out of my control?
import {defineConfig, transformWithEsbuild} from 'vite';
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import { createHtmlPlugin } from 'vite-plugin-html';
import baseViteConfig from "./base.config";
const serverUrl = ":1070/";
export default defineConfig({
...baseViteConfig,
mode: 'development',
root: path.resolve(__dirname, '../src'),
build: {
outDir: path.resolve(__dirname, '../dist'),
rollupOptions: {
input: {
main: path.resolve(__dirname, '../src/index.html')
},
output: {
entryFileNames: 'client.min.js'
}
}
},
plugins: [
react(),
createHtmlPlugin({
inject: {
data: {
serverUrl: serverUrl
}
},
minify: false,
template: '../src/maintenance.html',
filename: '../dist/maintenance.html'
})
],
server: {
open: true,
hot: true,
watch: {
usePolling: true
}
},
esbuild: {
loader: "tsx", // OR "jsx"
include: [
// Add this for business-as-usual behaviour for .jsx and .tsx files
"src/**/*.jsx",
"src/**/*.tsx",
// Add these lines to allow all .js files to contain JSX
"src/**/*.js",
// Add these lines to allow all .ts files to contain JSX
"src/**/*.ts",
],
},
});
errors
[TypeScript] Found 0 errors. Watching for file changes.
✘ [ERROR] Unterminated string literal
node_modules/react-multiselect-checkboxes/lib/DropdownButton.jsx:33:2:
33 │ ',
╵ ^
✘ [ERROR] Expected ";" but found "CheckboxOption"
node_modules/react-multiselect-checkboxes/lib/CheckboxOption.jsx:41:1:
41 │ }CheckboxOption.defaultProps = {
│ ~~~~~~~~~~~~~~
╵ ;
✘ [ERROR] Unterminated regular expression
node_modules/react-multiselect-checkboxes/lib/Dropdown.jsx:10:74:
10 │ {isOpen ? <Menu rightAligned={rightAligned>{children}</Menu> : null}
╵ ^
✘ [ERROR] The symbol "getOptionValue" has already been declared
node_modules/react-multiselect-checkboxes/lib/CheckboxGroup.jsx:20:8:
20 │ const getOptionValue = props.selectProps.getOptionValue;
╵ ~~~~~~~~~~~~~~
The symbol "getOptionValue" was originally declared here:
node_modules/react-multiselect-checkboxes/lib/CheckboxGroup.jsx:7:8:
7 │ const {
╵ ^
I understand these are actual errors, but I can't remove them. Webpack built it with no issue
I am trying build using vite. How can I make it not error out on packages out of my control?
import {defineConfig, transformWithEsbuild} from 'vite';
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import { createHtmlPlugin } from 'vite-plugin-html';
import baseViteConfig from "./base.config";
const serverUrl = ":1070/";
export default defineConfig({
...baseViteConfig,
mode: 'development',
root: path.resolve(__dirname, '../src'),
build: {
outDir: path.resolve(__dirname, '../dist'),
rollupOptions: {
input: {
main: path.resolve(__dirname, '../src/index.html')
},
output: {
entryFileNames: 'client.min.js'
}
}
},
plugins: [
react(),
createHtmlPlugin({
inject: {
data: {
serverUrl: serverUrl
}
},
minify: false,
template: '../src/maintenance.html',
filename: '../dist/maintenance.html'
})
],
server: {
open: true,
hot: true,
watch: {
usePolling: true
}
},
esbuild: {
loader: "tsx", // OR "jsx"
include: [
// Add this for business-as-usual behaviour for .jsx and .tsx files
"src/**/*.jsx",
"src/**/*.tsx",
// Add these lines to allow all .js files to contain JSX
"src/**/*.js",
// Add these lines to allow all .ts files to contain JSX
"src/**/*.ts",
],
},
});
errors
[TypeScript] Found 0 errors. Watching for file changes.
✘ [ERROR] Unterminated string literal
node_modules/react-multiselect-checkboxes/lib/DropdownButton.jsx:33:2:
33 │ ',
╵ ^
✘ [ERROR] Expected ";" but found "CheckboxOption"
node_modules/react-multiselect-checkboxes/lib/CheckboxOption.jsx:41:1:
41 │ }CheckboxOption.defaultProps = {
│ ~~~~~~~~~~~~~~
╵ ;
✘ [ERROR] Unterminated regular expression
node_modules/react-multiselect-checkboxes/lib/Dropdown.jsx:10:74:
10 │ {isOpen ? <Menu rightAligned={rightAligned>{children}</Menu> : null}
╵ ^
✘ [ERROR] The symbol "getOptionValue" has already been declared
node_modules/react-multiselect-checkboxes/lib/CheckboxGroup.jsx:20:8:
20 │ const getOptionValue = props.selectProps.getOptionValue;
╵ ~~~~~~~~~~~~~~
The symbol "getOptionValue" was originally declared here:
node_modules/react-multiselect-checkboxes/lib/CheckboxGroup.jsx:7:8:
7 │ const {
╵ ^
I understand these are actual errors, but I can't remove them. Webpack built it with no issue
本文标签: javascriptVite errors out from nodemodulesStack Overflow
版权声明:本文标题:javascript - Vite errors out from node_modules - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745618913a2159457.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论