Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glob Pattern for sideEffects in package.json Not Preventing Tree-Shaking #9737

Open
SyMind opened this issue May 24, 2024 · 1 comment
Open

Comments

@SyMind
Copy link

SyMind commented May 24, 2024

馃悰 bug report

馃帥 Configuration (.babelrc, package.json, cli command)

package.json with the following content for a dependency called foo:

{
  "name": "foo",
  "sideEffects": [ "**.css.js" ]
}

Import a side-effect file in my project:

import 'foo/style/button.css.js';

馃 Expected Behavior

The imported file button.css.js should be included in the production bundle due to the specified glob pattern in sideEffects, which indicates that any .css.js files should not be treated as having no side effects.

馃槸 Current Behavior

The file button.css.js is being removed from the production bundle, which suggests that the sideEffects property is not working as intended.

馃拋 Possible Solution

Fix in the PR: devongovett/glob-match#12

馃敠 Context

馃捇 Code Sample

馃實 Your Environment

Software Version(s)
Parcel
Node
npm/Yarn
Operating System
@SyMind
Copy link
Author

SyMind commented Jul 11, 2024

@mischnic cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant