Changes for PR #30

This commit is contained in:
Alex Dima 2019-03-04 15:09:02 +01:00
parent 6c73d7f708
commit 6b2271c1c1
9 changed files with 128 additions and 181 deletions

View file

@ -29,8 +29,6 @@ bundleOne('monaco.contribution');
bundleOne('tsMode');
bundleOne('tsWorker');
updateImports('monaco.contribution');
function bundleOne(moduleId, exclude) {
requirejs.optimize({
baseUrl: 'release/dev/',
@ -38,8 +36,7 @@ function bundleOne(moduleId, exclude) {
out: 'release/min/' + moduleId + '.js',
exclude: exclude,
paths: {
'vs/language/typescript': REPO_ROOT + '/release/dev',
'vs/basic-languages': REPO_ROOT + '/node_modules/monaco-languages/release/dev'
'vs/language/typescript': REPO_ROOT + '/release/dev'
},
optimize: 'none'
}, function(buildResponse) {
@ -56,10 +53,3 @@ function bundleOne(moduleId, exclude) {
fs.writeFileSync(filePath, BUNDLED_FILE_HEADER + result.code);
})
}
function updateImports(moduleId) {
const filePath = path.join(REPO_ROOT, 'release/esm/' + moduleId + '.js');
let fileContents = fs.readFileSync(filePath).toString();
fileContents = fileContents.replace(/vs\/basic-languages\//g, "../../basic-languages/");
fs.writeFileSync(filePath, fileContents);
}