-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplugin.js
More file actions
34 lines (27 loc) · 771 Bytes
/
plugin.js
File metadata and controls
34 lines (27 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const fs = require('fs')
const path = require('path')
function ExtendScriptPlugin(options) {}
ExtendScriptPlugin.prototype.apply = function(compiler) {
compiler.plugin('emit', function(compilation, callback) {
var interface = fs.readFileSync(path.join(__dirname, './lib/CSInterface.js'))
var json = fs.readFileSync(path.join(__dirname, './lib/JSON.es'))
compilation.assets['interface.es'] = {
source: function() {
return interface.toString();
},
size: function() {
return 1;
}
};
compilation.assets['json.es'] = {
source: function() {
return json.toString();
},
size: function() {
return 1;
}
};
callback();
});
};
module.exports = ExtendScriptPlugin;