question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rollup: doesn't remove linaria from bundle without using plugins, which produces browser error

See original GitHub issue

Environment

linaria - 1.3.1 rollup - 1.6.0 rollup-plugin-css-only - 1.0.0

Description

When using only css function with rollup, linaria is not removed from bundle and is set as a global variable. If you run it, browser will give you an error.

To solve this, currently you need to use rollup-plugin-node-resolve and rollup-plugin-commonjs. If linaria will be correctly removed from bundle, this plugins won’t be needed.

Reproducible Demo

Repo - https://github.com/vladshcherbin/experiments/tree/master/linaria-rollup-global

Run: yarn build

I’ve also added pre-built files and build/index.html file to see error.

Rollup warnings:

Screen Shot 2019-03-11 at 01 05 38

Probably related: https://github.com/callstack/linaria/issues/293

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vladshcherbincommented, Jun 18, 2020

@eemeli solution should be added to docs example because following current example will result in an error.

0reactions
jayucommented, Jun 16, 2020

I’m glad that there is a workaround, we could think of implementing https://github.com/callstack/linaria/issues/293 to solve the issue in it’s source

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get rollup to deal with node based libraries in the ...
You should first solve problems in your terminal. Which are like compile errors. Then ones in a browser, which are more like runtime....
Read more >
Linaria: Zero-runtime CSS in JS Library - Morioh
Linaria currently supports webpack and Rollup to extract the CSS at build time. To configure your bundler, check the following guides:.
Read more >
The ultimate guide to modern web application performance
The following tools are reducing the javascript files size by removing the unnecessary characters, renaming variables or even executing some ...
Read more >
Untitled
Estagio no mpf df, First marine division patch stars, Iyarkai mp3 tamil, The savior is ... Debian installer bug report, Use foundation brush...
Read more >
@material-ui/lab | Yarn - Package Manager
Material UI v4 doesn't receive active development since September 2021. ... This package hosts the incubator components that are not yet ready to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found