mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
dev-bundle exposes the shell script that downloads the dev bundle. We need this in a package because both star-translate and tools/bundler.js need access to it.
20 lines
619 B
JavaScript
20 lines
619 B
JavaScript
var path = Npm.require('path');
|
|
|
|
var handler = function (compileStep) {
|
|
var source = compileStep.read().toString('utf8');
|
|
var source_obj = { source: source };
|
|
var filename = path.basename(compileStep.inputPath);
|
|
var target = compileStep.inputPath + '.js';
|
|
var code = '//@export shellScripts\nif (! shellScripts) shellScripts = {};';
|
|
code = code + '\nshellScripts["' + filename + '"] =' +
|
|
JSON.stringify(source_obj) + ';';
|
|
compileStep.addJavaScript({
|
|
path: target,
|
|
data: code,
|
|
sourcePath: compileStep.inputPath,
|
|
lineForLine: false
|
|
});
|
|
};
|
|
|
|
Plugin.registerSourceHandler('in', handler);
|