Skip to content

ReferenceError: require is not defined: Update to fully support ESM. #68

@davtha-aa

Description

@davtha-aa

Describe the bug
ReferenceError: require is not defined
at file:///Users/me/../../../node_modules/tailwindcss-scoped-preflight/dist/plugin.modern.mjs:156:23

Occurs when in an ESM environment. package.json has type module

plugin.modern.mjs

const baseCssPath = require.resolve('tailwindcss/lib/css/preflight.css');

Expected behaviour
Builds without error.

Solution:
Update plugin.modern.mjs to not use require

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions