2018-11-06 02:04:41 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
*/
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
|
|
|
const RuntimeModule = require("../RuntimeModule");
|
|
|
|
|
|
|
|
class ChunkNameRuntimeModule extends RuntimeModule {
|
|
|
|
constructor(chunkName) {
|
|
|
|
super("chunkName");
|
|
|
|
this.chunkName = chunkName;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {TODO} generateContext context
|
|
|
|
* @returns {string} runtime code
|
|
|
|
*/
|
2018-11-06 01:50:58 +08:00
|
|
|
generate(generateContext) {
|
2018-11-06 02:04:41 +08:00
|
|
|
return `${RuntimeGlobals.chunkName} = ${JSON.stringify(this.chunkName)};`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = ChunkNameRuntimeModule;
|