mike-diamond / media-query-splitting-plugin

Webpack 4 plugin for styles splitting by media query
MIT License
106 stars 17 forks source link

StatsWriterPlugin? #16

Open ZebraFlesh opened 4 years ago

ZebraFlesh commented 4 years ago

Does this plugin work with the webpack-stats-plugin? Once I include media-query-splitting I see the files in the output folder on disk, but they aren't showing up in the webpack stats object (so I can't transform them and then load them into the HTML file I'm generating).

edit: Here's the entire stats object I'm receiving in my transform function:

{
  assetsByChunkName: {
    main: [
      'index.5f4730ed.css',
      'index.573e07e5.js',
      'index.573e07e5.js.map'
    ]
  }
}
{
  assetsByChunkName: {
    main: [
      'index-legacy.5f4730ed.css',
      'index-legacy.3fe56758.js',
      'index-legacy.3fe56758.js.map'
    ]
  }
}
sergionsz commented 3 years ago

It also doesn't work with webpack-bundle-tracker, which is necessary for this to work with django-webpack-loader. The assets do show in compilation stats when using the option --json=compilation-stats.json, but they don't appear to belong to any chunk name, which is why I think the files generated with this plugin are not being recognized by any stats package:

{
  "name": "css/main.2e58273f1e81233664d0.css",
  "size": 193743,
  "chunks": [6],
  "chunkNames": ["main"],
  "info": {
    "immutable": true
  },
  "emitted": true
}, {
  "name": "css/main.desktop.fd69067b6db4eae2aa024e3c208c5322bf1f608e.css",
  "size": 34880,
  "chunks": [],
  "chunkNames": [],
  "info": {},
  "emitted": true
},