ngx-store
Version:
Angular decorators to automagically keep variables in HTML5 LocalStorage, SessionStorage, cookies; injectable services for managing and listening to data changes and a bit more.
23 lines • 973 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addConfigToIndex = void 0;
const schematics_1 = require("@angular-devkit/schematics");
function addConfigToIndex() {
return (tree, _context) => {
var _a;
const fileName = './src/index.html';
const content = (_a = tree.read(fileName)) === null || _a === void 0 ? void 0 : _a.toString();
if (!content) {
throw new schematics_1.SchematicsException(`Couldn't find src/index.html file`);
}
const head = '<head>';
const position = content.indexOf(head) + head.length;
const template = `\n\t<script src="/assets/js/ngx-store.config.js"></script>`;
const recorder = tree.beginUpdate(fileName);
recorder.insertRight(position, template);
tree.commitUpdate(recorder);
return tree;
};
}
exports.addConfigToIndex = addConfigToIndex;
//# sourceMappingURL=add-config-to-index.rule.js.map