Questions tagged [rollupjs]

Rollup.js is a next-generation JavaScript Transpiler and module bundler

rollup.js is a module bundler, similar to browserify, but targeting code written as ES2015 modules.

Rollup takes advantage of the fact that ES2015 import and export declarations are statically analyzable and only bundles the functions / values that are actually referenced.

1172 questions
0
votes
0 answers

Rollup, not tree-shaking properly, providing full bundle

I'm having an issue tree-shaking with rollup. I exported a new function min that does basically nothing from my utils/index.js module. Along with it in that file there are a ton of imports and other exported functions. When I bundle I'm seeing a…
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424
0
votes
1 answer

Rollup with CommonJS module exporting an unnamed function as the module?

I have a CommonJS module, called inner.js, that defines a function and then exports that function as the entire module: // inner.js, a legacy CommonJS module var foo = function() { return 42; }; module.exports = foo; In Node, I can readily verify…
Ahmed Fasih
  • 6,458
  • 7
  • 54
  • 95
0
votes
1 answer

Rollup error from angular2-material input module

I was following the tutorial here http://blog.mgechev.com/2016/06/26/tree-shaking-angular2-production-build-rollup-javascript/ When I try to run rollup, I got this error. Module…
0
votes
0 answers

Angular2 RC4 build with tree shaking runtime error

I tried to build my test app with tree shaking according to this post. http://blog.mgechev.com/2016/06/26/tree-shaking-angular2-production-build-rollup-javascript/ The build scripts runs OK but then I got runtime error when I used the bundle.js. …
Shawn
  • 5,130
  • 13
  • 66
  • 109
0
votes
1 answer

Using node modules with Rollup to build web client

I'm trying to build a react application using rollup instead of browserify and babel. I realize I need to use the rollup-plugin-babel to transpile jsx, but when I tell rollup the format is iife, the final page loads with an error: Uncaught…
JRJurman
  • 1,615
  • 2
  • 19
  • 30
0
votes
1 answer

Bundle ractive with ractive-load through Rollup

What is the correct way to import ractive and ractive-load to my rollup project? npm or github? Currently I am using npm to install each one: npm install --save-dev ractivejs/ractive And npm install --save-dev ractivejs/ractive-load And I'm using…
Paulo Coghi
  • 13,724
  • 14
  • 68
  • 90
-1
votes
0 answers

"randomUUID" is not exported by "__vite-browser-external", #14210

Describe the bug npm run build is failing with Error: "randomUUID" is not exported by "__vite-browser-external" Here is my vite.config.ts import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { crx } from…
ishandutta2007
  • 16,676
  • 16
  • 93
  • 129
-1
votes
0 answers

Rollup: Change the output destination of an input html file

While building I wish to change the output destination to an input file when using rollup+vite. An Example MVE: Input src/ | foo/ | | foo.html | bar | | bar.css Desired Output dist/ | foo.html | assets/ | | name.css Current Output dist/ | src/ | |…
SamHDev
  • 172
  • 1
  • 14
-1
votes
1 answer

Rollup modules but keep all variables global

I will simplify code for my problem. So let's assume I have in module1.js export class MyClass { }; and in index.js import { MyClass } from './module1.js' var X = MyClass(); Next i want to bundle index.js with rollup in such way that the result…
-1
votes
1 answer

Generate a chunk name without hash

For my specific condition I don't want to generate hash in file name for some specific files. I tried something like this, but its removing hash from .css files but not for the .js files. build: { target: 'es2020', rollupOptions: { …
coure2011
  • 40,286
  • 83
  • 216
  • 349
-1
votes
1 answer

How to import local file system path instead of node_module in Rollup?

For some reason, I have to write code like this: import { something } from '/Users/my-user-name/my-working-dir/my-package/src/somefile.ts'; Rollup sees /Users thinks that's a node_modules, but not. I can't find any rollup plugin related to…
Joseph
  • 3,974
  • 7
  • 34
  • 67
-1
votes
1 answer

rollup-plugin-typescript does not recognize 'lib' in 'compilerOptions'

I'm following this tutorial for creating an npm package. Here is my tsconfig.json: { "compilerOptions": { "target": "es5", "module": "es2015", "sourceMap": true, "moduleResolution": "node", …
Zeus82
  • 6,065
  • 9
  • 53
  • 77
-1
votes
1 answer

Does nodejs use the module key to publish its es6 API?

The rollup documentation has the following example of importing the util.ajax function: import { ajax } from 'utils'; Does node expose an ES6 module containing utils via the module key on package.json and is this the general pattern used by NodeJS?…
Ole
  • 41,793
  • 59
  • 191
  • 359
-2
votes
0 answers

Rollup throwing error: " [!] SyntaxError: Unexpected token '(' "

I have a rollup configurations files and when I run it, it throws an exception that: [!] SyntaxError: Unexpected token '(' at DefaultModuleLoader.moduleStrategy (node:internal/modules/esm/translators:116:18) at…
-2
votes
3 answers

Problems with rollupjs configuration

When building my TypeScript project (all node modules are up to date) with the following configuration I get a error message called "Error: When building multiple chunks, the output.dir option must be used, not output.file." Can anyone help?…
Natasha
  • 516
  • 7
  • 24
1 2 3
78
79