UNPKG

typescript-react-loadable-plugin

Version:

A react-loadable plugin to add modules & webpack for typescript

36 lines 1.4 kB
"use strict"; /*! * Copyright 2019 acrazing <joking.young@gmail.com>. All rights reserved. * @since 2019-10-31 19:20:27 */ Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var path = tslib_1.__importStar(require("path")); var State = /** @class */ (function () { function State(options) { this.getWebpackChunkName = options.getWebpackChunkName || (function (request, context) { return (path .basename(request) .split('.') .filter(function (s) { return !!s; })[0] || path.basename(path.dirname(request)) || path.dirname(context)); }); this.moduleKind = options.moduleKind || 'userRequest'; this.identifiers = new Set(options.identifiers || ['Loadable']); this.webpack = options.webpack !== false; this.modules = options.modules !== false; this.webpackChunkName = options.webpackChunkName !== false || this.moduleKind === 'webpackChunkName'; } State.prototype.setSourceFile = function (source) { this.sourceFile = source; this.sourceContext = path.dirname(source.fileName); }; return State; }()); exports.State = State; //# sourceMappingURL=State.js.map