Pwa-studio: [bug]: npx bundlesize will result in error

Created on 9 Aug 2019  路  3Comments  路  Source: magento/pwa-studio

Describe the bug
When you want to check the bundleSize this it will result in an error:
There is no matching file for ./packages/venia-concept/dist/js/{client,vendor}.js in /Users/jordan/experius/domains/pwa-studio

To Reproduce
Steps to reproduce the behavior:

  1. run npx bundlesize
  2. See error

Expected behavior
Show PASS for all defined files

Additional context
The reason this bug happens is because inside the newly created packages/pwa-buildpack/lib/WebpackTools/configureWebpack.js at line 102 js/ is removed.

Possible solutions
See https://github.com/magento/pwa-studio/issues/1542#issuecomment-538468098.


Please let us know what packages this bug is in regards to:

  • [x] venia-concept
  • [x] pwa-buildpack
  • [ ] peregrine
  • [ ] pwa-devdocs
  • [ ] upward-js
  • [ ] upward-spec
good first issue bug hacktoberfest

Most helpful comment

I'll take this.

All 3 comments

I think this can be fixed by just removing js/ from the bundlesize config paths in the root package.json.

That said, we might want to consider updating these as I don't think they make sense anymore and we generate many more bundles than this checks. For example, there are the RootCmp files we should check along with sw.js and the renamed vendor~client-[0-9]+.js file.

To populate the venia-concept/dist folder, run yarn build.

New paths are of the following form:

Screen Shot 2019-10-04 at 11 23 39 AM

We want to update the bundlesize entries in package.json to match these filenames:

  "bundlesize": [
    {
      "path": "./packages/venia-concept/dist/js/{client,vendor}.js",
      "maxSize": "250 kB"
    },
    {
      "path": "./packages/venia-concept/dist/js/[0-9]-*.js",
      "maxSize": "100 kB"
    }
  ]

I'll take this.

Was this page helpful?
0 / 5 - 0 ratings