From 3c771b8ff7c6371c7b5d4d2487aa3326fa705939 Mon Sep 17 00:00:00 2001 From: maoshu Date: Wed, 31 Jul 2019 14:31:27 +0800 Subject: [PATCH] fix: when output.library is set, template.getAssetPath is not a function --- lib/JsonpChunkTemplateOverridePlugin.js | 10 +++------- package.json | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/JsonpChunkTemplateOverridePlugin.js b/lib/JsonpChunkTemplateOverridePlugin.js index eb3a291..d805380 100644 --- a/lib/JsonpChunkTemplateOverridePlugin.js +++ b/lib/JsonpChunkTemplateOverridePlugin.js @@ -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) { @@ -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) } diff --git a/package.json b/package.json index 688112c..3f2f08c 100644 --- a/package.json +++ b/package.json @@ -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 (https://github.com/somewind)",