import component by clientAppEnhance.js, docs:build but SyntaxError: Unexpected token 'export', how can i do #665
-
clientAppEnhance.js import ArcoVue from '@arco-design/web-vue'
import ArcoVueIcon from '@arco-design/web-vue/es/icon'
import '@arco-design/web-vue/dist/arco.css'
import { defineClientAppEnhance } from '@vuepress/client'
export default defineClientAppEnhance(({ app, router, siteData }) => {
app.use(ArcoVue)
app.use(ArcoVueIcon)
}) and when i run npm run docs:build and then yarn run v1.22.17
$ vuepress build docs
info Initializing VuePress and preparing data...
⠴ Compiling with vite
(!) Some chunks are larger than 500 KiB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✔ Compiling with vite - done
✖ Rendering pages - failed
export { default } from "./arco-vue-icon.js";
^^^^^^
SyntaxError: Unexpected token 'export'
at compileFunction (<anonymous>)
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Module.<anonymous> (D:\workspace_vite\crco\docs\.vuepress\dist\.server\app.js:28:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. |
Beta Was this translation helpful? Give feedback.
Answered by
Mister-Hope
Feb 4, 2022
Replies: 1 comment 1 reply
-
Try webpack, if webpack is working, should be the same problem as #585 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
seepine
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try webpack, if webpack is working, should be the same problem as #585