Skip to content

Commit

Permalink
fix: when output.library is set, template.getAssetPath is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
somewind committed Jul 31, 2019
1 parent 1ee9988 commit 3c771b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions lib/JsonpChunkTemplateOverridePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ class JsonpChunkTemplateOverridePlugin {
* @param {JsonpChunkTemplateOverridePluginOptions} options the plugin options
*/
constructor (options) {
if (!options || typeof options === 'string') {
this.name = options
} else {
this.name = options.name
this.wrapper = options.wrapper
}
this.wrapper = options.wrapper
}

_wrapper (chunkTemplate) {
Expand Down Expand Up @@ -56,7 +51,8 @@ class JsonpChunkTemplateOverridePlugin {

return wrapper({
template: chunkTemplate,
name: this.name,
// vendor no need to use name
// name: undefined,
wrapper: this.wrapper
})(newSource, chunk)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amd-webpack-plugin",
"version": "1.0.16",
"version": "1.0.17",
"license": "MIT",
"description": "make split chunks to be AMD modules",
"author": "somewind <[email protected]> (https://github.com/somewind)",
Expand Down

0 comments on commit 3c771b8

Please sign in to comment.