Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permit plugins to add assets directly to the bundle in Rollup 1.x (#3105
- Loading branch information
1 parent
1b72941
commit cb5227c
Showing
10 changed files
with
61 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
description: 'supports emitting assets in a hacky way by editing the bundle object', | ||
options: { | ||
strictDeprecations: false, | ||
plugins: { | ||
generateBundle(options, outputBundle) { | ||
const file = { | ||
fileName: 'my-hacky-asset.txt', | ||
isAsset: true, | ||
source: 'My Hacky Source' | ||
}; | ||
outputBundle[file.fileName] = file; | ||
} | ||
} | ||
} | ||
}; |
5 changes: 5 additions & 0 deletions
5
test/form/samples/deprecated/emit-asset-hacky/_expected/amd.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,5 @@ | ||
define(function () { 'use strict'; | ||
|
||
console.log('main'); | ||
|
||
}); |
3 changes: 3 additions & 0 deletions
3
test/form/samples/deprecated/emit-asset-hacky/_expected/cjs.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,3 @@ | ||
'use strict'; | ||
|
||
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 @@ | ||
console.log('main'); |
6 changes: 6 additions & 0 deletions
6
test/form/samples/deprecated/emit-asset-hacky/_expected/iife.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,6 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
console.log('main'); | ||
|
||
}()); |
1 change: 1 addition & 0 deletions
1
test/form/samples/deprecated/emit-asset-hacky/_expected/my-hacky-asset.txt
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 @@ | ||
My Hacky Source |
10 changes: 10 additions & 0 deletions
10
test/form/samples/deprecated/emit-asset-hacky/_expected/system.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,10 @@ | ||
System.register([], function () { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
console.log('main'); | ||
|
||
} | ||
}; | ||
}); |
8 changes: 8 additions & 0 deletions
8
test/form/samples/deprecated/emit-asset-hacky/_expected/umd.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,8 @@ | ||
(function (factory) { | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
factory(); | ||
}(function () { 'use strict'; | ||
|
||
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 @@ | ||
console.log('main'); |