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.

setup preflight:false doesn't work in Preact wmr dev server

See original GitHub issue

(Twind version 0.15.8)

I am able to merge new values into Tailwind’s default preflight reset (see example below), but preflight: false doesn’t work as intended (just in case, I also tried preflight: 0, preflight: null and preflight: undefined, to no avail).

setup({
		preflight: (preflight) => {
			console.log(preflight);
			return css({
				h1: {
					color: 'red',
				},
			});
		},
});

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:29 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
danielweckcommented, Mar 5, 2021

You are right. The twind/shim module is unpure / has side effects.

The problem was hard to diagnose at first because of tree shaking (i.e. an unused import is discarded, but a simple console.log on one of the module exports triggers the inclusion of the module in the bundle / execution context). So I decided to look at Twind’s source code and was glad to see that I could re-implement the shim easily thanks to the public observer methods 😃

Thanks for your work by the way, much appreciated!

1reaction
danielweckcommented, Mar 5, 2021

…for example, this is the twind/observe “sub”-package: https://unpkg.com/browse/twind@0.15.8/observe/package.json

What is wrong with that? Same as preact. Or did I miss something? I think the difference is the relative import from within sub-package JS file.

My point exactly (sorry, I was writing from my tiny phone keyboard so I probably wasn’t clear enough 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preact CLI or WMR? · Issue #867 - GitHub
My current project was set up using preact-cli . I've been happily using it for close to two years now. Lately though I've...
Read more >
Get Started with WMR
Create a new project in seconds using create-wmr. This tiny tool instantly scaffolds a new project for you, with npm scripts for development...
Read more >
Configuration and Theming - Twind
The setup function is a named export of the twind module and accepts a configuration object as an argument. TIP. The setup function...
Read more >
How to configure the preact dev server to use a different ...
The solution is not preact.config.js, as I thought, but preact-cli, which accepts a number of parameters to configure the webserver:
Read more >
The Preact Team Releases WMR to Simplify Modern Web App ...
Jason Miller, creator of 3KB Preact alternative to React, recently released WMR, a *tiny all-in-one development tool for modern web apps*.
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