Site-kit-wp: Fix release build process to exclude unnecessary files

Created on 31 Jul 2019  路  4Comments  路  Source: google/site-kit-wp

Bug Description

The release ZIP created from npm run release-zip currently includes a few files that aren't necessary (either old relicts, or development-related):

  • /bin/local-env directory
  • /dist/admin.js
  • /dist/adminbar.js
  • /dist/wpdashboard.js

Correct me if I'm wrong, but I don't see these JS files used anywhere, the actual files for these areas are all below /dist/assets.

The release-zip command should be fixed to not include the above files in the ZIP.

cc @adamsilverstein


_Do not alter or remove anything below. The following sections will be managed by moderators only._

Acceptance criteria

  • When running npm run release-zip, the following files are not included in the resulting ZIP:

    • /bin/local-env directory

    • /dist/admin.js

    • /dist/adminbar.js

    • /dist/wpdashboard.js

Implementation Brief

Note: the dist/*.js files are being created unnecessarily, this is a known webpack issue and there is currently no straight forward way to prevent them from being created from webpack configuration. The safest is to exclude them from the zip release.

Changelog entry

  • Remove unnecessary development files from the release build.
P0 Bug

Most helpful comment

For the js files, this is known issue in webpack and there doesn't seem to be a straight forward way to prevent these files from being created from the webpack config. The safest way is to exclude them from being added to the release zip.

See https://github.com/webpack/webpack/issues/1967

All 4 comments

/bin/local-env is a new folder and will need to be explicitly excluded.
/dist/admin.js adminbar and wpdashboard all appear to be unintentional build artifacts - ideally these files should not be created at all.

Looks like they are coming from here: https://github.com/google/site-kit-wp/blob/6ceafe33e0b5119211d23ba7c15193cdee17a08f/webpack.config.js#L288-L337

For the js files, this is known issue in webpack and there doesn't seem to be a straight forward way to prevent these files from being created from the webpack config. The safest way is to exclude them from being added to the release zip.

See https://github.com/webpack/webpack/issues/1967

Implementation brief looks good!

QA looks good

Was this page helpful?
0 / 5 - 0 ratings