Skip to content

Instantly share code, notes, and snippets.

View s-KaiNet's full-sized avatar
:octocat:
May the --force be with you

Sergei Sergeev s-KaiNet

:octocat:
May the --force be with you
View GitHub Profile
@s-KaiNet
s-KaiNet / gulpfile.js
Created January 13, 2021 20:55
Watch JSON formatting files and dynamically inject "$schema" property in a new generated file.
const { watch } = require('gulp');
const path = require('path');
const fs = require('fs');
const defaultColumnSchemaUrl = 'https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json';
const defaultViewSchemaUrl = 'https://developer.microsoft.com/json-schemas/sp/v2/view-formatting.schema.json';
exports.default = function () {
const watcher = watch(['**/*.column{-,.}format.json', '**/*.view{-,.}format.json']);