Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebuildCesium: true #17

Closed
1sm23 opened this issue Dec 27, 2021 · 4 comments
Closed

rebuildCesium: true #17

1sm23 opened this issue Dec 27, 2021 · 4 comments

Comments

@1sm23
Copy link

1sm23 commented Dec 27, 2021

cesium({
      rebuildCesium: true,
    })

加了rebuildCesium 后打包报错
Cant build with option rebuildCesium

transforming (5977) src\components\Menu\src\components\BasicMenuItem.vue[commonjs] Expecting Unicode escape sequence \uXXXX (65:98) in E:/repo/vue-vben-admin/node_modules/.pnpm/cesium@1.88.0/node_modules/cesium/Source/Core/buildModuleUrl.js
file: E:/repo/vue-vben-admin/node_modules/.pnpm/cesium@1.88.0/node_modules/cesium/Source/Core/buildModuleUrl.js:65:98
63:   if (!defined(baseUrlString)) {
64:     throw new DeveloperError(
65:       "Unable to determine Cesium base URL automatically, try defining a global variable called "\\cesium\\"."
                                                                                                      ^
66:     );
67:   }
error during build:
SyntaxError: Expecting Unicode escape sequence \uXXXX (65:98) in E:/repo/vue-vben-admin/node_modules/.pnpm/cesium@1.88.0/node_modules/cesium/Source/Core/buildModuleUrl.js
    at Parser.pp$4.raise (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:19596:13)
    at Parser.pp.invalidStringToken (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:21481:10)
    at Parser.pp.readWord1 (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:21647:16)
    at Parser.pp.readWord (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:21666:19)
    at Parser.pp.readToken (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:20943:19)
    at Parser.pp.nextToken (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:20936:15)
    at Parser.pp.next (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:20897:8)
    at Parser.pp$5.parseLiteral (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:19034:8)
    at Parser.pp$5.parseExprAtom (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:18920:17)
    at Parser.pp$5.parseExprSubscripts (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:18763:19)
    at Parser.pp$5.parseMaybeUnary (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:18729:17)
    at Parser.pp$5.parseExprOps (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:18656:19)
    at Parser.pp$5.parseMaybeConditional (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:18639:19)
    at Parser.pp$5.parseMaybeAssign (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:18606:19)
    at Parser.pp$5.parseExprList (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:19475:18)
    at Parser.pp$5.parseNew (E:\repo\vue-vben-admin\node_modules\.pnpm\rollup@2.62.0\node_modules\rollup\dist\shared\rollup.js:19144:57)
 ELIFECYCLE  Command failed with exit code 1.
@1sm23
Copy link
Author

1sm23 commented Dec 27, 2021

刚刚拉 demo 测了一下,也能复现
Reproduction on vite-plugin-cesium/demo
image

@nshen
Copy link
Owner

nshen commented Dec 27, 2021

感谢提醒,这个应该又是个 windows 路径问题,在 WSL 下是好用的,Mac 和 Linux应该也可以。
我也不知道怎么改哎,没装环境。。你要帮我改改吗?

@1sm23
Copy link
Author

1sm23 commented Dec 27, 2021

嗯!我看看

@1sm23
Copy link
Author

1sm23 commented Jan 5, 2022

Windows 下 \cesium\ JSON.stringify 后变成 \\cesium\\

@1sm23 1sm23 closed this as completed Jan 13, 2022
nshen added a commit that referenced this issue Jan 13, 2022
- support `build.outDir` #18
- fix buid error on windows when rebuildCesium:true #17
- add build test ci, cool! by @Lunagod
- set chunkSizeWarningLimit to 5000 when rebuildCesium
- clean code, add some commants.

Thanks @Lunagod and @1sm23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants