plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Custom bundle doesn't generate CSS file anymore.

Open SolidTux opened this issue 1 year ago • 6 comments

When generating a custom bundle, no CSS file is generated any more, even though it's mentioned in the output.

Steps to reproduce

$ git clone https://github.com/plotly/plotly.js.git
$ cd plotly.js
$ git checkout e6b155c1c91603eb0946f111bc3415b222422230
$ npm install
$ npm run custom-bundle -- --traces sunburst --transforms none --strict --out sunburst
> [email protected] custom-bundle
> node tasks/custom_bundle.mjs --traces sunburst --transforms none --strict --out sunburst

{
  traceList: [ 'scatter', 'sunburst' ],
  name: 'sunburst',
  index: '/users/tkm/dhauck/kekse/plotly.js/lib/index-strict-sunburst.js',
  strict: true,
  dist: '/users/tkm/dhauck/kekse/plotly.js/dist/plotly-sunburst.js',
  distMin: '/users/tkm/dhauck/kekse/plotly.js/dist/plotly-sunburst.min.js'
}

  dist/plotly-sunburst.min.js    1.0mb ⚠️
  dist/plotly-sunburst.min.css  63.9kb

⚡ Done in 750ms

This results in the following extra files being generated:

$ git clean -dxn
Would remove dist/plotly-sunburst.min.js
Would remove lib/index-strict-sunburst.js
Would remove node_modules/

SolidTux avatar Oct 31 '24 11:10 SolidTux

It looks like it was introduced in commit e7f57483127df5747669ba46d0a033e5fd54cdef:

e7f57483127df5747669ba46d0a033e5fd54cdef is the first bad commit
commit e7f57483127df5747669ba46d0a033e5fd54cdef
Author: Mojtaba Samimi <[email protected]>
Date:   Wed Oct 30 17:20:28 2024 -0400

    remove unused empty css files

 tasks/util/bundle_wrapper.mjs | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

So either the output claiming it's 64 kB is wrong or the file gets wrongly deleted.

SolidTux avatar Oct 31 '24 12:10 SolidTux

@archmoj please have a look when you can and let us know if the problem is output or deletion

gvwilson avatar Oct 31 '24 19:10 gvwilson

The CSS outputs were empty and removed. @SolidTux Do you have any use case for it?

archmoj avatar Nov 05 '24 17:11 archmoj

No, I realized that it works without the CSS now. But the output of the tool is still incorrect, right? The output isn't 64kB.

SolidTux avatar Nov 07 '24 10:11 SolidTux

No, I realized that it works without the CSS now. But the output of the tool is still incorrect, right? The output isn't 64kB.

Yes. It looks like a esbuild bug.

archmoj avatar Nov 07 '24 17:11 archmoj

@archmoj do you think this is a bug in esbuild itself or in the way we're using it? i.e., is it their problem or ours? thx - @gvwilson

gvwilson avatar Nov 07 '24 18:11 gvwilson