Commit
* Generate sourcemaps without comment using `hidden` option (#2743) Signed-off-by: Rohit Mohan <rohitmohan96@gmail.com> * Added tests for hidden sourcemaps Signed-off-by: Rohit Mohan <rohitmohan96@gmail.com> * Added cli tests for hidden sourcemaps Signed-off-by: Rohit Mohan <rohitmohan96@gmail.com> * Update documentation and improve test
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const fs = require('fs'); | ||
const assert = require('assert'); | ||
|
||
module.exports = { | ||
description: 'omits sourcemap comments', | ||
command: 'rollup -i main.js -f es -m hidden -o output.js', | ||
test() { | ||
assert.equal(fs.readFileSync('output.js', 'utf-8').trim(), 'console.log( 42 );'); | ||
fs.unlinkSync('output.js'); | ||
assert.equal( | ||
fs.readFileSync('output.js.map', 'utf-8').trim(), | ||
'{"version":3,"file":"output.js","sources":["main.js"],"sourcesContent":' + | ||
'["console.log( 42 );\\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC"}' | ||
); | ||
fs.unlinkSync('output.js.map'); | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log( 42 ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
description: 'correct sourcemaps are written (separate file) without comment', | ||
skipIfWindows: true, | ||
options: { | ||
output: { sourcemap: 'hidden' } | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
define(function () { 'use strict'; | ||
|
||
function foo () { | ||
console.log( 'hello from foo.js' ); | ||
} | ||
|
||
function bar () { | ||
console.log( 'hello from bar.js' ); | ||
} | ||
|
||
console.log( 'hello from main.js' ); | ||
|
||
foo(); | ||
bar(); | ||
|
||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
function foo () { | ||
console.log( 'hello from foo.js' ); | ||
} | ||
|
||
function bar () { | ||
console.log( 'hello from bar.js' ); | ||
} | ||
|
||
console.log( 'hello from main.js' ); | ||
|
||
foo(); | ||
bar(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function foo () { | ||
console.log( 'hello from foo.js' ); | ||
} | ||
|
||
function bar () { | ||
console.log( 'hello from bar.js' ); | ||
} | ||
|
||
console.log( 'hello from main.js' ); | ||
|
||
foo(); | ||
bar(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
function foo () { | ||
console.log( 'hello from foo.js' ); | ||
} | ||
|
||
function bar () { | ||
console.log( 'hello from bar.js' ); | ||
} | ||
|
||
console.log( 'hello from main.js' ); | ||
|
||
foo(); | ||
bar(); | ||
|
||
}()); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
System.register([], function () { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
function foo () { | ||
console.log( 'hello from foo.js' ); | ||
} | ||
|
||
function bar () { | ||
console.log( 'hello from bar.js' ); | ||
} | ||
|
||
console.log( 'hello from main.js' ); | ||
|
||
foo(); | ||
bar(); | ||
|
||
} | ||
}; | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(function (factory) { | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
factory(); | ||
}(function () { 'use strict'; | ||
|
||
function foo () { | ||
console.log( 'hello from foo.js' ); | ||
} | ||
|
||
function bar () { | ||
console.log( 'hello from bar.js' ); | ||
} | ||
|
||
console.log( 'hello from main.js' ); | ||
|
||
foo(); | ||
bar(); | ||
|
||
})); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function bar () { | ||
console.log( 'hello from bar.js' ); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function foo () { | ||
console.log( 'hello from foo.js' ); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import foo from './foo'; | ||
import bar from './bar'; | ||
|
||
console.log( 'hello from main.js' ); | ||
|
||
foo(); | ||
bar(); |