Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Allow excluding based on chunk name #74

Open
LarsDenBakker opened this issue Apr 13, 2020 · 8 comments
Open

Allow excluding based on chunk name #74

LarsDenBakker opened this issue Apr 13, 2020 · 8 comments

Comments

@LarsDenBakker
Copy link

In my rollup build I have a large prebuilt chunk, which I separate using manualChunks. I'd like to be able to exclude this chunk from terser, but unfortunately I can't because terser exclude option acts on the fileName property. This is is the hashed named, which I don't know and can't match on.

I'd like to propose terser to exclude based on the name field, so that you can exclude based on the actual chunk name. See rollup/rollup#3497 for context.

@TrySound
Copy link
Owner

I wanted to drop include/exclude support anyway. But if there is a use case I would accept a PR with breaking change.

@TrySound
Copy link
Owner

I'm dropping include/exclude support in upcoming major release. You are free to add new behaviour.

@mrchief
Copy link

mrchief commented Sep 16, 2020

What's the migration path like? How do we exclude going forward?

@TrySound
Copy link
Owner

@mrchief What's your use case?

@mrchief
Copy link

mrchief commented Sep 17, 2020

Trying to avoid minifying already minified file.

@chris-kruining
Copy link

I would also like this, in my case I have html coming through as a chunk to be rendered, and I would like to filter it out so the the JS is still minified

@chris-kruining
Copy link

I see this pattern in a lot of plugins

import { createFilter } from '@rollup/pluginutils';
const filter = createFilter(include, exclude)
.....
async load(id) {
      if (!filter(id)) return null;

@bennypowers
Copy link
Contributor

this pattern is getting mangled:

class MyElement extends Whatever {
  static get is() { return 'my-element'; }
}
customElements.define(MyElement.is, MyElement);

Uncaught DOMException: CustomElementRegistry.define: 'ye' is not a valid custom element name.

I'd much rather minify that js file myself at an earlier build step, but this otherwise excellent doesn't honour the typical include/exclude options that almost every other rollup plugin has. Please consider putting those options back.

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

No branches or pull requests

5 participants