Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b07d38
commit f677bef
Showing
15 changed files
with
118 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { assertStderrIncludes } = require('../../../utils.js'); | ||
|
||
module.exports = { | ||
description: 'displays warnings for broken sourcemaps', | ||
command: 'rollup -c', | ||
stderr: stderr => { | ||
fs.unlinkSync(path.resolve(__dirname, 'bundle')); | ||
fs.unlinkSync(path.resolve(__dirname, 'bundle.map')); | ||
assertStderrIncludes( | ||
stderr, | ||
'(!) Broken sourcemap\n' + | ||
'https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect\n' + | ||
"Plugins that transform code (such as 'test-plugin1', 'test-plugin2' and 'test-plugin3') should generate accompanying sourcemaps" | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('main'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
input: 'main.js', | ||
plugins: [ | ||
{ | ||
name: 'test-plugin1', | ||
transform(code) { | ||
return code + '/*1*/'; | ||
} | ||
}, | ||
{ | ||
name: 'test-plugin2', | ||
transform(code) { | ||
return code + '/*2*/'; | ||
} | ||
}, | ||
{ | ||
name: 'test-plugin3', | ||
transform(code) { | ||
return code + '/*3*/'; | ||
} | ||
} | ||
], | ||
output: { | ||
format: 'esm', | ||
file: 'bundle', | ||
sourcemap: true | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
description: 'allows specifying the export mode to be "default"', | ||
options: { | ||
output: { | ||
exports: 'default', | ||
name: 'bundle' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
define(function () { 'use strict'; | ||
|
||
var main = 42; | ||
|
||
return main; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
var main = 42; | ||
|
||
module.exports = main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var main = 42; | ||
|
||
export default main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var bundle = (function () { | ||
'use strict'; | ||
|
||
var main = 42; | ||
|
||
return main; | ||
|
||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
System.register('bundle', [], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
var main = exports('default', 42); | ||
|
||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.bundle = factory()); | ||
}(this, (function () { 'use strict'; | ||
|
||
var main = 42; | ||
|
||
return main; | ||
|
||
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default 42; |
14 changes: 14 additions & 0 deletions
14
test/function/samples/invalid-default-export-mode/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
solo: true, | ||
description: 'throw for invalid default export mode', | ||
options: { | ||
output: { | ||
exports: 'default' | ||
} | ||
}, | ||
generateError: { | ||
code: 'INVALID_EXPORT_OPTION', | ||
message: | ||
'"default" was specified for "output.exports", but entry module "main.js" has the following exports: default, foo' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export default 42; | ||
export const foo = 43; |