Make WordPress Core

12/24/2018 01:28:22 PM (9 months ago)

Build tools: Allow building WordPress to src.

After the JavaScript reorganization in [43309], it was no longer possible to test WordPress from the src folder. That meant a build step was required to test PHP modifications. That is suboptimal as even a simple copy is slower than a web server just serving the new file.

We achieve building to src by setting a WORKING_DIR constant in the Gruntfile that is build by default, but changes to src when the --dev flag is present on any Grunt command. We provide sensible defaults so some commands, such as copying version.php, always build to build.

Because testing from build is no longer required, we change the messages present in index.php and wp-admin/index.php to be more broadly about building WordPress.

We also change the webpack config to have more straightforward behavior based on the buildTarget argument. It only determines the build target now and has no implicit behavior anymore. grunt build still works as it worked before, to make sure that the build server produces the same wordpress.zip we are used to.

We do all this instead of a symlink setup because symlinks don't work on every platform.

Props omarreiss, netweb, flixos90, SergeyBiryukov.
Fixes #44492.

1 edited


  • trunk/package-lock.json

    r44356 r44359  
    25092509        "browserify-rsa": {
    25102510            "version": "4.0.1",
    2511             "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
     2511            "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
    25122512            "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=",
    25132513            "dev": true,
    28422842        "chalk": {
    28432843            "version": "1.1.3",
    2844             "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
     2844            "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
    28452845            "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
    28462846            "requires": {
    50505050        "events": {
    50515051            "version": "1.1.1",
    5052             "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
     5052            "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz",
    50535053            "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=",
    50545054            "dev": true
    1112111121        "onetime": {
    1112211122            "version": "1.1.0",
    11123             "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
     11123            "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
    1112411124            "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
    1112511125            "dev": true
    1120111201        "os-locale": {
    1120211202            "version": "1.4.0",
    11203             "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
     11203            "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
    1120411204            "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
    1120511205            "dev": true,
    1299812998        "regjsgen": {
    1299912999            "version": "0.2.0",
    13000             "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
     13000            "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
    1300113001            "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc="
    1300213002        },
    1358013580                "source-map": {
    1358113581                    "version": "0.4.4",
    13582                     "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
     13582                    "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
    1358313583                    "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
    1358413584                    "dev": true,
Note: See TracChangeset for help on using the changeset viewer.