luwes / luwes/rollup-plugin-size

Saving filesizes to disk doesn't happen

Open
#8 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
65
Forks
2
PR merge metrics
No merged PRs in 30d

Description

I can see there's an option `writeFile` and it is set to true by default, and a file named `size-plugin.json` should appear where sizes are being written to. Such a file never appears for me
and when I rollup my sources (without the watch option) it always looks like there were no changes to last run:

Screenshot 2019-12-12 at 10 38 57

I tested in Nodejs 12.10.0 as well as 13.2.0.

Here's an excerpt of my rollup config (I have tried to specify an explicit file name there, but both relying on the default and using an explicit file name fail):

```js
export default [
{
input: 'src/api.mjs',
output: [
// config for
{
file: pkg.module,
format: 'esm'
},
// config for <script nomodule>
{
file: pkg.browser,
format: 'umd',
name: 'Cookies',
noConflict: true,
banner: ';'
}
],
plugins: [licenseBanner]
},
{
input: 'src/api.mjs',
output: [
// config for <script type="module">
{
file: pkg.module.replace('.mjs', '.min.mjs'),
format: 'esm'
},
// config for <script nomodule>
{
file: pkg.browser.replace('.js', '.min.js'),
format: 'umd',
name: 'Cookies',
noConflict: true
}
],
plugins: [
terser(),
licenseBanner, // must be applied after terser, otherwise it's being stripped away...
size({ filename: 'sizes-min.json' })
]
}
]
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the shown Rollup configuration and the writeFile option set to true. Trace where size-plugin.json and the explicit sizes-min.json filename are handled, then verify that a file is created and records changes between non-watch builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, rollup
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.