UNPKG

polymer-project-config

Version:

reads, validates, and shapes your polymer.json project configuration

329 lines (327 loc) • 17.3 kB
{ "$schema": "http://json-schema.org/draft-06/schema#", "definitions": { "JsCompileTarget": { "enum": [ "es2015", "es2016", "es2017", "es2018", "es5" ], "type": "string" }, "LintOptions": { "properties": { "filesToIgnore": { "description": "An array of file globs to never report warnings for.\n\nThe globs follow [minimatch] syntax, and any file that matches any\nof the listed globs will never show any linter warnings. This will\ntypically not have a performance benefit, as the file will usually\nstill need to be analyzed.\n\n[minimatch]: https://github.com/isaacs/minimatch", "items": { "type": "string" }, "type": "array" }, "ignoreWarnings": { "description": "Deprecated way of spelling the `warningsToIgnore` lint option.\n\nUsed only if `warningsToIgnore` is not specified.", "items": { "type": "string" }, "type": "array" }, "rules": { "description": "The lint rules to run. Can be the code of a collection of rules like\n\"polymer-2\" or an individual rule like \"dom-module-invalid-attrs\".", "items": { "type": "string" }, "type": "array" }, "warningsToIgnore": { "description": "Warnings to ignore. After the rules are run, any warning that matches\none of these codes is ignored, project-wide.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "ModuleResolutionStrategy": { "enum": [ "node", "none" ], "type": "string" }, "ProjectBuildOptions": { "properties": { "addPushManifest": { "description": "If `true`, generate an [HTTP/2 Push\nManifest](https://github.com/GoogleChrome/http2-push-manifest) for your\napplication.", "type": "boolean" }, "addServiceWorker": { "description": "Generate a service worker for your application to cache all files and\nassets on the client.\n\nPolymer CLI will generate a service worker for your build using the\n[sw-precache library](https://github.com/GoogleChrome/sw-precache). To\ncustomize your service worker, create a sw-precache-config.js file in your\nproject directory that exports your configuration. See the [sw-precache\nREADME](https://github.com/GoogleChrome/sw-precache) for a list of all\nsupported options.\n\nNote that the sw-precache library uses a cache-first strategy for maximum\nspeed and makes some other assumptions about how your service worker should\nbehave. Read the \"Considerations\" section of the sw-precache README to make\nsure that this is suitable for your application.", "type": "boolean" }, "basePath": { "description": "Update the entrypoint's `<base>` tag, to support serving this build from a\nnon-root path, such as when doing differential serving based on user\nagent. Requires that a `<base>` tag already exists. This works well in\nconjunction with the convention of using relative URLs for static\nresources and absolute URLs for application routes.\n\nIf `true`, use the build `name`. If a `string`, use that value.\nLeading/trailing slashes are optional.", "type": [ "string", "boolean" ] }, "browserCapabilities": { "description": "Capabilities required for a browser to consume this build. Values include\n`es2015` and `push`. See canonical list at:\nhttps://github.com/Polymer/prpl-server-node/blob/master/src/capabilities.ts\n\nThis field is purely a hint to servers reading this configuration, and\ndoes not affect the build process. A server supporting differential\nserving (e.g. prpl-server) can use this field to help decide which build\nto serve to a given user agent.", "items": { "enum": [ "es2015", "es2016", "es2017", "es2018", "modules", "push", "serviceworker" ], "type": "string" }, "type": "array" }, "bundle": { "anyOf": [ { "properties": { "excludes": { "description": "URLs of files and/or folders that should not be inlined.", "items": { "type": "string" }, "type": "array" }, "inlineCss": { "description": "Inline external CSS file contents into <style> tags.", "type": "boolean" }, "inlineScripts": { "description": "Inline external Javascript file contents into <script> tags.", "type": "boolean" }, "rewriteUrlsInTemplates": { "description": "Rewrite element attributes inside of templates when inlining html.", "type": "boolean" }, "sourcemaps": { "description": "Create identity source maps for inline scripts.", "type": "boolean" }, "stripComments": { "description": "Remove all comments except those tagged '@license', or starting with\n`<!--!` or `<!--#`, when true.", "type": "boolean" }, "treeshake": { "description": "Remove unreachable/unused code when bundling.", "type": "boolean" } }, "type": "object" }, { "type": "boolean" } ], "description": "By default, fragments are unbundled. This is optimal for HTTP/2-compatible\nservers and clients.\n\nIf the --bundle flag is supplied, all fragments are bundled together to\nreduce the number of file requests. This is optimal for sending to clients\nor serving from servers that are not HTTP/2 compatible." }, "css": { "description": "Options for processing CSS.", "properties": { "minify": { "anyOf": [ { "properties": { "exclude": { "description": "CSS files listed here will not be minified.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, { "type": "boolean" } ], "description": "Minify inlined and external CSS." } }, "type": "object" }, "html": { "description": "Options for processing HTML.", "properties": { "minify": { "anyOf": [ { "properties": { "exclude": { "description": "HTML files listed here will not be minified.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, { "type": "boolean" } ], "description": "Minify HTMl by removing comments and whitespace." } }, "type": "object" }, "insertPrefetchLinks": { "description": "Insert prefetch link elements into your fragments so that all dependencies\nare prefetched immediately. Add dependency prefetching by inserting `<link\nrel=\"prefetch\">` tags into entrypoint and `<link rel=\"import\">` tags into\nfragments and shell for all dependencies.\n\nNote this option may trigger duplicate requests. See\nhttps://github.com/Polymer/polymer-build/issues/239 for details.", "type": "boolean" }, "js": { "description": "Options for processing JavaScript.", "properties": { "compile": { "anyOf": [ { "properties": { "exclude": { "description": "JavaScript files listed here will not be compiled.", "items": { "type": "string" }, "type": "array" }, "target": { "$ref": "#/definitions/JsCompileTarget" } }, "type": "object" }, { "enum": [ "es2015", "es2016", "es2017", "es2018", "es5", false, true ] } ], "description": "Use babel to compile all ES6 JS down to ES5 for older browsers." }, "minify": { "anyOf": [ { "properties": { "exclude": { "description": "JavaScript files listed here will not be minified.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, { "type": "boolean" } ], "description": "Minify inlined and external JavaScript." }, "transformModulesToAmd": { "description": "Transform ES modules to AMD modules.", "type": "boolean" } }, "type": "object" }, "name": { "description": "The name of this build, used to determine the output directory name.", "type": "string" }, "preset": { "description": "A build preset for this build. A build can inherit some base configuration\nfrom a named preset.", "type": "string" }, "swPrecacheConfig": { "description": "A config file that's passed to the [sw-precache\nlibrary](https://github.com/GoogleChrome/sw-precache). See [its\nREADME](https://github.com/GoogleChrome/sw-precache) for details of the\nformat of this file.\n\nIgnored if `addServiceWorker` is not `true`.\n\nDefaults to `\"sw-precache-config.js`.", "type": "string" } }, "type": "object" } }, "properties": { "autoBasePath": { "description": "Set `basePath: true` on all builds. See that option for more details.", "type": "boolean" }, "builds": { "description": "List of build option configurations.", "items": { "$ref": "#/definitions/ProjectBuildOptions" }, "type": "array" }, "componentDir": { "description": "The directory containing this project's dependencies.", "type": "string" }, "entrypoint": { "description": "The path relative to `root` of the entrypoint file that will be served for\napp-shell style projects. Usually this is index.html.", "type": "string" }, "extraDependencies": { "description": "List of file paths, relative to the project directory, that should be\nincluded as extraDependencies in the build target.", "items": { "type": "string" }, "type": "array" }, "fragments": { "description": "The path relative to `root` of the lazily loaded fragments. Usually the\npages of an app or other bundles of on-demand resources.", "items": { "type": "string" }, "type": "array" }, "lint": { "$ref": "#/definitions/LintOptions", "description": "Options for the Polymer Linter." }, "moduleResolution": { "$ref": "#/definitions/ModuleResolutionStrategy", "description": "Algorithm to use for resolving module specifiers in import and export\nstatements when rewriting them to be web-compatible. Valid values are:\n\n\"none\": Disable module specifier rewriting. This is the default.\n\"node\": Use Node.js resolution to find modules." }, "npm": { "description": "Sets other options' defaults to NPM-appropriate values:\n\n - 'componentDir': 'node_modules/'", "type": "boolean" }, "root": { "description": "Path to the root of the project on the filesystem. This can be an absolute\npath, or a path relative to the current working directory. Defaults to the\ncurrent working directory of the process.", "type": "string" }, "shell": { "description": "The path relative to `root` of the app shell element.", "type": "string" }, "sources": { "description": "List of glob patterns, relative to root, of this project's sources to read\nfrom the file system.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }