Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only overwrite content when resolving import.meta properties
- Loading branch information
1 parent
e66d7be
commit c92cdcd
Showing
27 changed files
with
122 additions
and
38 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
4 changes: 2 additions & 2 deletions
4
test/chunking-form/samples/configure-file-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
4 changes: 2 additions & 2 deletions
4
test/chunking-form/samples/configure-file-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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict'; | ||
|
||
const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-9b321da2.txt:format=cjs:relativePath=../assets/asset-solved-9b321da2.txt:assetReferenceId=6296c678:chunkReferenceId=null' | ||
const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=cjs:relativePath=chunk.js:assetReferenceId=null:chunkReferenceId=f6c25ae7' | ||
const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-9b321da2.txt:format=cjs:relativePath=../assets/asset-solved-9b321da2.txt:assetReferenceId=6296c678:chunkReferenceId=null'; | ||
const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=cjs:relativePath=chunk.js:assetReferenceId=null:chunkReferenceId=f6c25ae7'; | ||
|
||
exports.asset = asset; | ||
exports.chunk = chunk; |
4 changes: 2 additions & 2 deletions
4
test/chunking-form/samples/configure-file-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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-9b321da2.txt:format=es:relativePath=../assets/asset-solved-9b321da2.txt:assetReferenceId=6296c678:chunkReferenceId=null' | ||
const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=es:relativePath=chunk.js:assetReferenceId=null:chunkReferenceId=f6c25ae7' | ||
const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-9b321da2.txt:format=es:relativePath=../assets/asset-solved-9b321da2.txt:assetReferenceId=6296c678:chunkReferenceId=null'; | ||
const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=es:relativePath=chunk.js:assetReferenceId=null:chunkReferenceId=f6c25ae7'; | ||
|
||
export { asset, chunk }; |
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
11 changes: 0 additions & 11 deletions
11
test/form/samples/configure-import-meta-url/_expected/es.js
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
test/form/samples/resolve-import-meta-url-export/_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,13 @@ | ||
module.exports = { | ||
description: 'correctly exports resolved import.meta.url', | ||
options: { | ||
plugins: [ | ||
{ | ||
resolveImportMeta(prop) { | ||
return prop ? "'url'" : "'meta'"; | ||
} | ||
} | ||
], | ||
output: { name: 'bundle' } | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/form/samples/resolve-import-meta-url-export/_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,11 @@ | ||
define(['module', 'exports'], function (module, exports) { 'use strict'; | ||
|
||
const url = 'url'; | ||
const meta = 'meta'; | ||
|
||
exports.meta = meta; | ||
exports.url = url; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
9 changes: 9 additions & 0 deletions
9
test/form/samples/resolve-import-meta-url-export/_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,9 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const url = 'url'; | ||
const meta = 'meta'; | ||
|
||
exports.meta = meta; | ||
exports.url = url; |
4 changes: 4 additions & 0 deletions
4
test/form/samples/resolve-import-meta-url-export/_expected/es.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 @@ | ||
const url = 'url'; | ||
const meta = 'meta'; | ||
|
||
export { meta, url }; |
12 changes: 12 additions & 0 deletions
12
test/form/samples/resolve-import-meta-url-export/_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,12 @@ | ||
var bundle = (function (exports) { | ||
'use strict'; | ||
|
||
const url = 'url'; | ||
const meta = 'meta'; | ||
|
||
exports.meta = meta; | ||
exports.url = url; | ||
|
||
return exports; | ||
|
||
}({})); |
11 changes: 11 additions & 0 deletions
11
test/form/samples/resolve-import-meta-url-export/_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,11 @@ | ||
System.register('bundle', [], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const url = exports('url', 'url'); | ||
const meta = exports('meta', 'meta'); | ||
|
||
} | ||
}; | ||
}); |
15 changes: 15 additions & 0 deletions
15
test/form/samples/resolve-import-meta-url-export/_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,15 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = global || self, factory(global.bundle = {})); | ||
}(this, function (exports) { 'use strict'; | ||
|
||
const url = 'url'; | ||
const meta = 'meta'; | ||
|
||
exports.meta = meta; | ||
exports.url = url; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: 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,2 @@ | ||
export const url = import.meta.url; | ||
export const meta = import.meta; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,11 @@ | ||
console.log('resolved'); | ||
console.log('resolved'); | ||
console.log('resolved'); | ||
|
||
console.log(import.meta.url); | ||
console.log(import.meta.privateProp); | ||
console.log(import.meta); | ||
|
||
console.log('url=es.js:resolve-import-meta-url/main.js'); | ||
console.log('privateProp=es.js:resolve-import-meta-url/main.js'); | ||
console.log('null=es.js:resolve-import-meta-url/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
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
File renamed without changes.
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 @@ | ||
console.log(import.meta.url); | ||
console.log(import.meta.privateProp); | ||
console.log(import.meta); |
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 @@ | ||
console.log(import.meta.url); | ||
console.log(import.meta.privateProp); | ||
console.log(import.meta); |