next-flight-css-dev-loader.js 784 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.pitch = pitch;
  6. exports.default = void 0;
  7. function pitch() {
  8. const content = this.fs.readFileSync(this.resource);
  9. this.data.__checksum = (typeof content === "string" ? Buffer.from(content) : content).toString("hex");
  10. }
  11. const NextServerCSSLoader = function(content) {
  12. this.cacheable && this.cacheable();
  13. const isCSSModule = this.resource.match(/\.module\.css$/);
  14. if (isCSSModule) {
  15. return content + "\nmodule.exports.__checksum = " + JSON.stringify(this.data.__checksum);
  16. }
  17. return `export default ${JSON.stringify(this.data.__checksum)}`;
  18. };
  19. var _default = NextServerCSSLoader;
  20. exports.default = _default;
  21. //# sourceMappingURL=next-flight-css-dev-loader.js.map