123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- "use strict";
- const makeSerializable = require("../util/makeSerializable");
- const NullDependency = require("./NullDependency");
- class CssExportDependency extends NullDependency {
-
- constructor(name, value) {
- super();
- this.name = name;
- this.value = value;
- }
- get type() {
- return "css :export";
- }
-
- getExports(moduleGraph) {
- const name = this.name;
- return {
- exports: [
- {
- name,
- canMangle: true
- }
- ],
- dependencies: undefined
- };
- }
-
- serialize(context) {
- const { write } = context;
- write(this.name);
- write(this.value);
- super.serialize(context);
- }
-
- deserialize(context) {
- const { read } = context;
- this.name = read();
- this.value = read();
- super.deserialize(context);
- }
- }
- CssExportDependency.Template = class CssExportDependencyTemplate extends (
- NullDependency.Template
- ) {
-
- apply(dependency, source, { cssExportsData }) {
- const dep = (dependency);
- cssExportsData.exports.set(dep.name, dep.value);
- }
- };
- makeSerializable(
- CssExportDependency,
- "webpack/lib/dependencies/CssExportDependency"
- );
- module.exports = CssExportDependency;
|