Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX lts] build: Turn off sourcemaps for TS-to-ES compilation #17128

Merged
merged 3 commits into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion broccoli/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ module.exports.getPackagesES = function getPackagesES() {
include: ['**/*.ts'],
});

let typescriptCompiled = typescript(debugTree(typescriptContents, `get-packages-es:ts:input`));
let typescriptCompiled = typescript(debugTree(typescriptContents, `get-packages-es:ts:input`), {
compilerOptions: {
sourceMap: false,
},
});

let debuggedCompiledTypescript = debugTree(typescriptCompiled, `get-packages-es:ts:output`);

Expand Down
27 changes: 27 additions & 0 deletions tests/node/sourcemap-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var fs = require('fs');

QUnit.module('sourcemap validation', function() {
var assets = ['ember.debug', 'ember.prod', 'ember.min'];

assets.forEach(asset => {
QUnit.test(`${asset} has only a single sourcemaps comment`, function(assert) {
var jsPath = `dist/${asset}.js`;
assert.ok(fs.existsSync(jsPath));
Turbo87 marked this conversation as resolved.
Show resolved Hide resolved

var contents = fs.readFileSync(jsPath, 'utf-8');
var num = count(contents, '//# sourceMappingURL=');
assert.equal(num, 1);
});
});
});

function count(source, find) {
var num = 0;

var i = -1;
while ((i = source.indexOf(find, i + 1)) !== -1) {
num += 1;
}

return num;
}