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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't ignore the entry file #174

Open
jaydenseric opened this issue Apr 6, 2020 · 3 comments
Open

Can't ignore the entry file #174

jaydenseric opened this issue Apr 6, 2020 · 3 comments

Comments

@jaydenseric
Copy link
Contributor

I have multiple size-limit entry files for server, browser, etc, like this:

[
  {
    "name": "Server",
    "path": "size-limit-entries/server.mjs",
    "limit": "2.6 KB",
    "ignore": ["./size-limit-entries/server.mjs", "prop-types"]
  },
  {
    "name": "Browser",
    "path": "size-limit-entries/browser.mjs",
    "limit": "2.6 KB",
    "ignore": ["./size-limit-entries/browser.mjs", "prop-types"]
  }
]

I don't want to include the entry files in the bundle size, as they only serve as a means to cherry pick relevant parts of the API for each size limit test and are not actually published.

For some reason none of these variations in the ignore array work:

  • size-limit-entries
  • size-limit-entries/browser.mjs
  • ./size-limit-entries
  • ./size-limit-entries/browser.mjs

When using --why:

Screen Shot 2020-04-06 at 6 54 49 pm

@ai
Copy link
Owner

ai commented Apr 6, 2020

Can you show the size before and after adding ignore? Do we have the problem with Webpack or only with --why?

@jaydenseric
Copy link
Contributor Author

There is no change for either the reported sizes, or for the --why report.

Before:

Screen Shot 2020-04-06 at 7 25 13 pm

After:

Screen Shot 2020-04-06 at 7 25 17 pm

@ai
Copy link
Owner

ai commented Apr 6, 2020

Unfortunately, I will have a very rough week because of moving to another project.

Can you help me with the investigation?

Here is how we ignore nodules: https://github.com/ai/size-limit/blob/master/packages/webpack/get-config.js#L80-L90

We use webpack’s externals option and I am not sure that we use it right for your case. If you will do some hacks in your project (just open this file in node_modules) it will speed up the issue.

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

2 participants