Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple build process from packaging process #3302

Closed
schlessera opened this issue Sep 19, 2019 · 1 comment · Fixed by #7144
Closed

Decouple build process from packaging process #3302

schlessera opened this issue Sep 19, 2019 · 1 comment · Fixed by #7144
Assignees
Labels
Changelogged Whether the issue/PR has been added to release notes. Groomed Infrastructure Changes impacting testing infrastructure or build tooling P2 Low priority WS:Core Work stream for Plugin core
Milestone

Comments

@schlessera
Copy link
Collaborator

schlessera commented Sep 19, 2019

When you run npm run build, it goes through all build:* tasks and processes them. This does not only trigger a fresh build (converting source files to build artifacts), but also triggers the packaging process (remove development dependencies and generate a ZIP archive).

As a follow-up to #3183, I'd like to decouple "building" from "packaging", so that npm run build only does the required steps to make the current source folder run as a valid plugin, and provide a separate npm run package (name up for debate) to optimize for a production environment and to generate a ZIP.

This seems to make sense, as an npm run build is something you need a lot during development, whereas you seldom need a ZIP file.

Related #3183, #1840

@schlessera schlessera added the Infrastructure Changes impacting testing infrastructure or build tooling label Sep 19, 2019
@kmyram kmyram added the P2 Low priority label Feb 18, 2020
@kmyram kmyram added the WS:Perf Work stream for Metrics, Performance and Optimizer label Aug 5, 2020
@schlessera schlessera added WS:Core Work stream for Plugin core and removed WS:Perf Work stream for Metrics, Performance and Optimizer labels Oct 21, 2020
@kmyram kmyram added the Groomed label Nov 24, 2020
@kmyram kmyram added this to the v2.1 milestone Nov 24, 2020
@westonruter westonruter removed this from the v2.1 milestone Dec 10, 2020
@thelovekesh thelovekesh self-assigned this Jun 10, 2022
@westonruter westonruter added this to the v2.3.1 milestone Jun 15, 2022
@westonruter westonruter modified the milestones: v2.3.1, v2.4 Jan 26, 2023
@thelovekesh
Copy link
Collaborator

QA Passed ✅

Before:
On executing npm run build:(dev|prod) following build:* scripts were get executed and results in:

  • Plugin zip as amp.zip
  • Plugin build as ./build dir
  • JS build files

amp-wp/package.json

Lines 106 to 109 in 4e54b03

"build:prepare": "grunt clean",
"build:js": "wp-scripts build",
"build:run": "grunt build",
"build:zip": "grunt create-build-zip",

After:
Now on executing the npm run build:(dev|prod) following build:* scripts get executed and generate JS build files.

amp-wp/package.json

Lines 107 to 108 in 68d9bb3

"build:prepare": "grunt clean",
"build:js": "wp-scripts build",

To generate a zip or plugin build following npm scripts are being used now.

amp-wp/package.json

Lines 130 to 133 in 68d9bb3

"package:dev": "cross-env NODE_ENV=development npm-run-all build:dev 'package:!(dev|prod)'",
"package:prod": "cross-env NODE_ENV=production npm-run-all build:prod 'package:!(dev|prod)'",
"package:run": "grunt build",
"package:zip": "grunt create-build-zip",

@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes. Groomed Infrastructure Changes impacting testing infrastructure or build tooling P2 Low priority WS:Core Work stream for Plugin core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants