All Questions
134
questions
-1
votes
1
answer
71
views
Merge a split chunk back into the entrypoint
I have a module with a good handful of chunks A, B, C, and D, all of which rely on a shared utilities file which Rollup separately chunks.
Because this utilities file is only a couple of Kb, and ...
0
votes
1
answer
14
views
backend dependency within Svelte component library gets imported on SvelteKit (Vite/Rollup) build
I created a Svelte component library which uses better-sqlite3 for some backend methods.
When building an app which uses this custom library, better-sqlite3 gets imported and bundled, causing issues ...
0
votes
0
answers
12
views
How to auto expose imported symbols to window/globalThis via Vite/Rollup
I'm using Vite
In my index.js entrypoint file I have a bunch of imports like:
import { truncate } from './utils';
But these are only visible to other code that is imported in index.js
The truncate ...
1
vote
0
answers
45
views
How to modify dynamically loaded <style> tags
I have a Vue ^2.7.15 application running on Vite ^4.5.0. When I run a dev server, <style> tags of each component are added into the <head> element, for example:
<style type="text/...
0
votes
1
answer
117
views
Vite, Laravel and Vue.js - Error: Your current platform "undefined" and architecture "undefined"
Versions:
Node v20.14.0
npm 10.7.0
Laravel v10.17.0
I use Vite, Vue.js and Laravel. When I run "npm run dev" and I open up the browser, I get the following Javascript error in browser's ...
0
votes
0
answers
31
views
forwardRef with Rollup config "preserveModules: true" breaks the build
Context
I'm working on an npm package with Vite and React. Here you can see my vite.config.mts :
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import react ...
0
votes
0
answers
14
views
VITE various build processes inside the same "project"
Ok, so I have a self-made monorepo where i have several vite projects, for various purposes.
3 of those projects, are extemely coupled to each other and i would love to have them in the same "...
2
votes
0
answers
77
views
RollupError: [type] is not exported by [file]
I followed this guide to make a UI library: https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma
When I try to build i get this error on my interfaces: ...
0
votes
1
answer
129
views
Using vite / rollup with npm workspaces, issue with react on production build
I am trying to create a local shared folder / workspace / package to share code between projects in a monorepo using npm workspaces, and it works in vite dev mode, but not when I build and preview ...
0
votes
1
answer
195
views
Vite multi page (HTML) and Tanstack Router
I'm working on a project that I'll need create 3 HTML files, and they will share the same JS source. The main reason is that I need 2 differents manifest files for each HTML, it will be a PWA ...
0
votes
0
answers
84
views
RollupError error: how to get the faulting file?
I'm using vite v5 (and thus rollup under the hood) to bundle a library.
When I build my project I get:
✓ 1430 modules transformed.
x Build failed in 52.11s
error during build:
RollupError: Could not ...
2
votes
1
answer
539
views
Getting Error during build: RollupError: expression expected after migrating from vue-cli to vite
I just migrated from vue-cli to vite. Serving locally works fine, but during the build, I got the following error:
x Build failed in 221ms
error during build:
RollupError: Expression expected
at ...
2
votes
1
answer
1k
views
Bundle library with externalized dependencies and Vite?
I'm trying to publish a library to npm that uses type: "module". I'm using vite's library mode with the following config:
export default defineConfig({
css: {
postcss: {
plugins: ...
-1
votes
2
answers
531
views
How to Precompile Vue 3 Components using Vite and Use Them as JS Module in Static HTML?
I'm currently exploring Vue 3 with Vite for a project, and I'm aiming to optimize the loading time of my web application. My strategy involves precompiling Vue components and using them as JavaScript ...
0
votes
1
answer
349
views
Can I use Vite/Rollup to just transpile to cjs/esm without bundling?
I'm looking to use Vite/Rollup to just transpile files from .ts/tsx to .cjs or .mjs files without bundling everything into one big file.
I know that it's the point of Rollup to roll everything up into ...