Making WordPress.org

Changeset 8524


Ignore:
Timestamp:
03/25/2019 09:44:31 PM (6 years ago)
Author:
iandunn
Message:

WordCamp Blocks: Add debug script with source maps.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/package.json

    r8510 r8524  
    4444    "scripts": {
    4545        "start": "cross-env BABEL_ENV=development NODE_ENV=development webpack --watch",
     46        "debug": "cross-env BABEL_ENV=development NODE_ENV=development SOURCE_MAPS=1 webpack --watch",
    4647        "build": "cross-env BABEL_ENV=production NODE_ENV=production webpack",
    4748        "lint:js": "wp-scripts lint-js ."
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/readme.md

    r8005 r8524  
    11111. `cd` into the project directory.
    12122. Run `npm run build` to initialize the build files.
    13 3. Run `npm start`  while developing to continuously watch the files.
     133. Run `npm start`  while developing to continuously watch the files. Alternatively, you can also run `npm run debug` to enable source maps.
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/webpack.config.js

    r8510 r8524  
    44
    55const NODE_ENV = process.env.NODE_ENV || 'development';
     6const SOURCE_MAPS = process.env.SOURCE_MAPS ? true : false;
     7
    68
    79const externals = {
     
    1214
    1315const webpackConfig = {
     16    // Must be 'none', 'production', or 'development'.
    1417    mode: NODE_ENV === 'production' ? 'production' : 'development',
    1518
     
    1821    },
    1922
    20     devtool: 'production' === NODE_ENV ? 'none' : 'cheap-module-eval-source-map',
     23    // Disabled by default because they make the re-build process take longer.
     24    devtool: SOURCE_MAPS ? 'cheap-module-eval-source-map' : 'none',
    2125
    2226    entry: {
Note: See TracChangeset for help on using the changeset viewer.