/** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ import {BrowserCapability} from 'browser-capabilities'; export type JsCompileTarget = 'es5'|'es2015'|'es2016'|'es2017'|'es2018'; export interface ProjectBuildOptions { /** * The name of this build, used to determine the output directory name. */ name?: string; /** * A build preset for this build. A build can inherit some base configuration * from a named preset. */ preset?: string; /** * Generate a service worker for your application to cache all files and * assets on the client. * * Polymer CLI will generate a service worker for your build using the * [sw-precache library](https://github.com/GoogleChrome/sw-precache). To * customize your service worker, create a sw-precache-config.js file in your * project directory that exports your configuration. See the [sw-precache * README](https://github.com/GoogleChrome/sw-precache) for a list of all * supported options. * * Note that the sw-precache library uses a cache-first strategy for maximum * speed and makes some other assumptions about how your service worker should * behave. Read the "Considerations" section of the sw-precache README to make * sure that this is suitable for your application. */ addServiceWorker?: boolean; /** * If `true`, generate an [HTTP/2 Push * Manifest](https://github.com/GoogleChrome/http2-push-manifest) for your * application. */ addPushManifest?: boolean; /** * A config file that's passed to the [sw-precache * library](https://github.com/GoogleChrome/sw-precache). See [its * README](https://github.com/GoogleChrome/sw-precache) for details of the * format of this file. * * Ignored if `addServiceWorker` is not `true`. * * Defaults to `"sw-precache-config.js`. */ swPrecacheConfig?: string; /** * Insert prefetch link elements into your fragments so that all dependencies * are prefetched immediately. Add dependency prefetching by inserting `` tags into entrypoint and `` tags into * fragments and shell for all dependencies. * * Note this option may trigger duplicate requests. See * https://github.com/Polymer/polymer-build/issues/239 for details. */ insertPrefetchLinks?: boolean; /** * By default, fragments are unbundled. This is optimal for HTTP/2-compatible * servers and clients. * * If the --bundle flag is supplied, all fragments are bundled together to * reduce the number of file requests. This is optimal for sending to clients * or serving from servers that are not HTTP/2 compatible. */ bundle?: boolean|{ /** URLs of files and/or folders that should not be inlined. */ excludes?: string[], /** Inline external CSS file contents into