-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
0089eb9
commit 5665701
Showing
43 changed files
with
332 additions
and
54 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Title</title> | ||
</head> | ||
<body> | ||
<script type="module" src="_actual/es/main.js"></script> | ||
</body> | ||
</html> |
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 @@ | ||
module.exports = { | ||
description: 'supports import.meta.url', | ||
options: { | ||
output: { | ||
chunkFileNames: 'nested/chunk.js' | ||
} | ||
} | ||
}; |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/import-meta-url/_expected/amd/main.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 @@ | ||
define(['module', 'require', './nested/chunk.js'], function (module, require, __chunk_1) { 'use strict'; | ||
|
||
__chunk_1.log('main: ' + new URL(module.uri, document.baseURI).href); | ||
new Promise(function (resolve, reject) { require(['./nested/chunk2.js'], resolve, reject) }); | ||
|
||
}); |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/import-meta-url/_expected/amd/nested/chunk.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,13 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerHTML += url + '<br>'; | ||
} | ||
} | ||
|
||
exports.log = log; | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/import-meta-url/_expected/amd/nested/chunk2.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(['module', './chunk.js'], function (module, __chunk_1) { 'use strict'; | ||
|
||
__chunk_1.log('nested: ' + new URL(module.uri, document.baseURI).href); | ||
|
||
}); |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/import-meta-url/_expected/cjs/main.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 @@ | ||
'use strict'; | ||
|
||
var __chunk_1 = require('./nested/chunk.js'); | ||
|
||
__chunk_1.log('main: ' + (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href))); | ||
Promise.resolve(require('./nested/chunk2.js')); |
11 changes: 11 additions & 0 deletions
11
test/chunking-form/samples/import-meta-url/_expected/cjs/nested/chunk.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,11 @@ | ||
'use strict'; | ||
|
||
function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerHTML += url + '<br>'; | ||
} | ||
} | ||
|
||
exports.log = log; |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/import-meta-url/_expected/cjs/nested/chunk2.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 @@ | ||
'use strict'; | ||
|
||
var __chunk_1 = require('./chunk.js'); | ||
|
||
__chunk_1.log('nested: ' + (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('nested/chunk2.js', document.baseURI).href))); |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/import-meta-url/_expected/es/main.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,4 @@ | ||
import { a as log } from './nested/chunk.js'; | ||
|
||
log('main: ' + import.meta.url); | ||
import('./nested/chunk2.js'); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/import-meta-url/_expected/es/nested/chunk.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,9 @@ | ||
function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerHTML += url + '<br>'; | ||
} | ||
} | ||
|
||
export { log as a }; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/import-meta-url/_expected/es/nested/chunk2.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 @@ | ||
import { a as log } from './chunk.js'; | ||
|
||
log('nested: ' + import.meta.url); |
15 changes: 15 additions & 0 deletions
15
test/chunking-form/samples/import-meta-url/_expected/system/main.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,15 @@ | ||
System.register(['./nested/chunk.js'], function (exports, module) { | ||
'use strict'; | ||
var log; | ||
return { | ||
setters: [function (module) { | ||
log = module.a; | ||
}], | ||
execute: function () { | ||
|
||
log('main: ' + module.meta.url); | ||
module.import('./nested/chunk2.js'); | ||
|
||
} | ||
}; | ||
}); |
18 changes: 18 additions & 0 deletions
18
test/chunking-form/samples/import-meta-url/_expected/system/nested/chunk.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,18 @@ | ||
System.register([], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
exports('a', log); | ||
|
||
function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerHTML += url + '<br>'; | ||
} | ||
} | ||
|
||
} | ||
}; | ||
}); |
14 changes: 14 additions & 0 deletions
14
test/chunking-form/samples/import-meta-url/_expected/system/nested/chunk2.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 @@ | ||
System.register(['./chunk.js'], function (exports, module) { | ||
'use strict'; | ||
var log; | ||
return { | ||
setters: [function (module) { | ||
log = module.a; | ||
}], | ||
execute: function () { | ||
|
||
log('nested: ' + module.meta.url); | ||
|
||
} | ||
}; | ||
}); |
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>AMD</title> | ||
</head> | ||
<body> | ||
<script src="../../../../node_modules/requirejs/require.js" data-main="_actual/amd/main.js"></script> | ||
</body> | ||
</html> |
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>ES Module</title> | ||
</head> | ||
<body> | ||
<script src="_actual/es/main.js" type="module"></script> | ||
</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
test/chunking-form/samples/import-meta-url/index-system.html
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>SystemJS</title> | ||
</head> | ||
<body> | ||
<script src="../../../../node_modules/systemjs/dist/s.js"></script> | ||
<script>System.import('./_actual/system/main.js');</script> | ||
</body> | ||
</html> |
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 @@ | ||
export function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerHTML += url + '<br>'; | ||
} | ||
} |
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,4 @@ | ||
import {log} from './log'; | ||
|
||
log('main: ' + import.meta.url); | ||
import('./nested.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 @@ | ||
import {log} from './log'; | ||
|
||
log('nested: ' + import.meta.url); |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
module.exports = { | ||
solo: true, | ||
description: 'import.meta.url support' | ||
description: 'supports import.meta.url' | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
define(['module'], function (module) { 'use strict'; | ||
|
||
document.body.innerText = new URL((typeof process !== 'undefined' && process.versions && process.versions.node ? 'file:' : '') + module.uri).href; | ||
function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerText = url; | ||
} | ||
} | ||
|
||
log(new URL(module.uri, document.baseURI).href); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
'use strict'; | ||
|
||
document.body.innerText = new (typeof URL !== 'undefined' ? URL : require('ur'+'l').URL)((process.browser ? '' : 'file:') + __filename, process.browser && document.baseURI).href; | ||
function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerText = url; | ||
} | ||
} | ||
|
||
log((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('cjs.js', document.baseURI).href))); |
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 |
---|---|---|
@@ -1 +1,9 @@ | ||
document.body.innerText = import.meta.url; | ||
function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerText = url; | ||
} | ||
} | ||
|
||
log(import.meta.url); |
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 |
---|---|---|
@@ -1,6 +1,14 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
document.body.innerText = (typeof document !== 'undefined' ? document.currentScript && document.currentScript.src || document.baseURI : new (typeof URL !== 'undefined' ? URL : require('ur'+'l').URL)('file:' + __filename).href); | ||
function log(url) { | ||
if (typeof document === 'undefined') { | ||
console.log(url); | ||
} else { | ||
document.body.innerText = url; | ||
} | ||
} | ||
|
||
log((document.currentScript && document.currentScript.src || new URL('iife.js', document.baseURI).href)); | ||
|
||
}()); |
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
Oops, something went wrong.