generate-sw-schema.js 659 B

12345678910111213141516171819202122
  1. "use strict";
  2. /*
  3. Copyright 2018 Google LLC
  4. Use of this source code is governed by an MIT-style
  5. license that can be found in the LICENSE file or at
  6. https://opensource.org/licenses/MIT.
  7. */
  8. const joi = require('@hapi/joi');
  9. const commonGenerateSchema = require('./common-generate-schema');
  10. const defaults = require('./defaults'); // Define some additional constraints.
  11. module.exports = commonGenerateSchema.keys({
  12. globDirectory: joi.string().required(),
  13. importScripts: joi.array().items(joi.string()),
  14. importWorkboxFrom: joi.string().default(defaults.importWorkboxFrom).valid('cdn', 'local', 'disabled'),
  15. swDest: joi.string().required()
  16. });