Skip to content

options

benholloway edited this page Mar 14, 2016 · 3 revisions

General settings

port      : 55555,           // port to serve during watch
unminified: false,           // switch to unminified
names     : 'app*, release', // list of compositions to include in the build
publicPath: undefined,       // CDN path for release builds
globals   : {},              // A hash of packages keyed by their global variable
stats     : {                // console output
  hash        : true,
  version     : true,
  timings     : true,
  assets      : true,
  chunks      : true,
  modules     : true,
  reasons     : true,
  children    : true,
  source      : true,
  errors      : true,
  errorDetails: true,
  warnings    : true,
  publicPath  : true
}

In detail:

  • names

    The format of the names option may be an Array of strings, or a single comma separated string.

    Names are the mode followed by a dot-delimted representation of the subdirectory of /app that the composition resides in. For example:

    • In app mode the root composition is named "app".
    • In release mode the root composition is named "release".
    • In app mode the composition /app/foo is named "app.foo".
    • In release mode the composition /app/foo is named "release.foo".

    An asterix * may be used to match any trailing character. Meaning, for example, that:

    • "*" will include all compositions in both app and release modes,
    • "app*" will include all compositions in app mode and nothing in release mode,

Full customisation

These additional settings may be used to deviate from Angularity's optinionated project structure.

appDir    : './app',           // your composition roots
buildDir  : './app-build',     // output of the app build
testDir   : './app-test',      // output of the test build
releaseDir: './app-release',   // output of the release build
testGlob  : '**/*.spec.js'     // identify your test files

Environment variables

All options may be parsed from uppercase keys and string values. This allows you to pass in environment variables without any additional parsing.

Use an underscrore to delimit camel-case, meaning buildDir is written as environment variable BUILD_DIR.

Use a double underscore to delimit a nested field, meaning stats.warnings is written as environment variable STATS__WARNINGS.

For example, to suppress warnings during the build:

{
  "scripts": {
    "silent": "cross-env STATS__WARNINGS=false webpack -d --progress"
  }
}
Clone this wiki locally