You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then on the main index.vue and while using pug preprocessor I'm retrieving it like so:
<templatelang="pug">
div {{`v${version}`}}<template><scriptsetup>
const version = ref('');
onMounted(() =>{version.value=window.__VERSION__;// I may be doing this wrong tho works on dev...}
While in dev it works perfectly well when trying to build it throws:
rollup-plugin-dynamic-import-variables] Unexpected token (385:24)
file: /Users/admin/WebstormProjects/vite/src/views/Index.vue:385:24
error during build:
SyntaxError: Unexpected token (385:24)
at Object.pp$4.raise (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:15591:13)
at Object.pp.unexpected (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:13283:8)
at Object.pp.semicolon (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:13260:64)
at Object.pp$1.parseExpressionStatement (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:13739:8)
at Object.pp$1.parseStatement (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:13474:24)
at Object.pp$1.parseBlock (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:13755:21)
at Object.pp$3.parseFunctionBody (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:15441:22)
at Object.pp$3.parseArrowExpression (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:15402:8)
at Object.pp$3.parseParenArrowList (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:15131:15)
at Object.pp$3.parseParenAndDistinguishExpression (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:15097:19)
at Object.pp$3.parseExprAtom (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:14950:41)
at Object.pp$3.parseExprSubscripts (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:14793:19)
at Object.pp$3.parseMaybeUnary (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:14770:17)
at Object.parseMaybeUnary (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:19515:29)
at Object.pp$3.parseExprOps (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:14705:19)
at Object.pp$3.parseMaybeConditional (/Users/admin/WebstormProjects/vite/node_modules/rollup/dist/shared/rollup.js:14688:19)
error Command failed with exit code 1.
System Info
vite version: 2.1.2
Operating System: Big Sur (Macbook Air M1)
Node version: v15.11.0
Package manager (npm/yarn/pnpm) and version: yarn 1.22.10
Describe the bug
Used
build.define
invite.config.ts
like below to display theversion
string frompackage.json
:Then on the main index.vue and while using pug preprocessor I'm retrieving it like so:
While in dev it works perfectly well when trying to build it throws:
System Info
vite
version: 2.1.2Logs (Optional if provided reproduction)
The text was updated successfully, but these errors were encountered: