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
605a825
commit 096f224
Showing
28 changed files
with
136 additions
and
22 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 |
---|---|---|
|
@@ -136,7 +136,6 @@ const outputOptions = { | |
|
||
// danger zone | ||
amd, | ||
dynamicImportFunction, | ||
esModule, | ||
exports, | ||
freeze, | ||
|
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
16 changes: 16 additions & 0 deletions
16
test/chunking-form/samples/deprecated/dynamic-import-comments/_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,16 @@ | ||
module.exports = { | ||
description: 'should not remove inline comments inside dynamic import', | ||
options: { | ||
strictDeprecations: false, | ||
input: 'main.js', | ||
onwarn() {}, | ||
plugins: { | ||
resolveDynamicImport() { | ||
return false; | ||
} | ||
}, | ||
output: { | ||
dynamicImportFunction: 'foobar' | ||
} | ||
} | ||
}; |
26 changes: 26 additions & 0 deletions
26
test/chunking-form/samples/deprecated/dynamic-import-comments/_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,26 @@ | ||
define(['require'], function (require) { 'use strict'; | ||
|
||
function _interopNamespace(e) { | ||
if (e && e.__esModule) { return e; } else { | ||
var n = {}; | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
}); | ||
}); | ||
} | ||
n['default'] = e; | ||
return n; | ||
} | ||
} | ||
|
||
new Promise(function (resolve, reject) { require([ | ||
/* webpackChunkName: "chunk-name" */ | ||
'./foo'/*suffix*/], function (m) { resolve(_interopNamespace(m)); }, reject) }); | ||
|
||
}); |
24 changes: 24 additions & 0 deletions
24
test/chunking-form/samples/deprecated/dynamic-import-comments/_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,24 @@ | ||
'use strict'; | ||
|
||
function _interopNamespace(e) { | ||
if (e && e.__esModule) { return e; } else { | ||
var n = {}; | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
}); | ||
}); | ||
} | ||
n['default'] = e; | ||
return n; | ||
} | ||
} | ||
|
||
new Promise(function (resolve) { resolve(_interopNamespace(require( | ||
/* webpackChunkName: "chunk-name" */ | ||
'./foo.js'/*suffix*/))); }); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/deprecated/dynamic-import-comments/_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,3 @@ | ||
foobar( | ||
/* webpackChunkName: "chunk-name" */ | ||
'./foo.js'/*suffix*/); |
12 changes: 12 additions & 0 deletions
12
test/chunking-form/samples/deprecated/dynamic-import-comments/_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,12 @@ | ||
System.register([], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
module.import( | ||
/* webpackChunkName: "chunk-name" */ | ||
'./foo.js'/*suffix*/); | ||
|
||
} | ||
}; | ||
}); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/deprecated/dynamic-import-comments/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,3 @@ | ||
import /* () should not break */ ( | ||
/* webpackChunkName: "chunk-name" */ | ||
'./foo.js'/*suffix*/); |
1 change: 1 addition & 0 deletions
1
...rm/samples/dynamic-import-name/_config.js → ...deprecated/dynamic-import-name/_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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
test/chunking-form/samples/dynamic-import-comments/_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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
module.exports = { | ||
description: 'should not remove inline comments inside dynamic import', | ||
description: 'does not remove inline comments inside dynamic imports', | ||
options: { | ||
input: 'main.js', | ||
onwarn() {}, | ||
plugins: { | ||
renderDynamicImport() { | ||
return { left: 'foobar(', right: ')' }; | ||
}, | ||
resolveDynamicImport() { | ||
return false; | ||
} | ||
}, | ||
output: { | ||
dynamicImportFunction: 'foobar' | ||
} | ||
} | ||
}; |
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
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
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
test/function/samples/deprecations/dynamicImportFunction/_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: 'marks the "output.dynamicImportFunction" option as deprecated', | ||
options: { | ||
output: { | ||
dynamicImportFunction: 'foo' | ||
} | ||
}, | ||
generateError: { | ||
code: 'DEPRECATED_FEATURE', | ||
message: | ||
'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.' | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/function/samples/deprecations/dynamicImportFunction/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,11 @@ | ||
const foo = {}; | ||
|
||
function doIt(x) { | ||
if (foo[x]) { | ||
return true; | ||
} | ||
foo[x] = true; | ||
} | ||
|
||
doIt('x'); | ||
assert.ok(doIt('x'), 'foo was not reassigned'); |