File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed
packages/@vue/cli-service Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 11// This file is imported into lib/wc client bundles.
22
33if ( typeof window !== 'undefined' ) {
4+ var currentScript = window . document . currentScript
45 if ( process . env . NEED_CURRENTSCRIPT_POLYFILL ) {
5- require ( 'current-script-polyfill' )
6+ var getCurrentScript = require ( '@soda/get-current-script' )
7+ currentScript = getCurrentScript ( )
8+
9+ // for backward compatibility, because previously we directly included the polyfill
10+ if ( ! ( 'currentScript' in document ) ) {
11+ Object . defineProperty ( document , 'currentScript' , { get : getCurrentScript } )
12+ }
613 }
714
8- var i
9- if ( ( i = window . document . currentScript ) && ( i = i . src . match ( / ( . + \/ ) [ ^ / ] + \. j s ( \? . * ) ? $ / ) ) ) {
10- __webpack_public_path__ = i [ 1 ] // eslint-disable-line
15+ var src = currentScript && currentScript . src . match ( / ( . + \/ ) [ ^ / ] + \. j s ( \? . * ) ? $ / )
16+ if ( src ) {
17+ __webpack_public_path__ = src [ 1 ] // eslint-disable-line
1118 }
1219}
1320
Original file line number Diff line number Diff line change 2525 "dependencies" : {
2626 "@intervolga/optimize-cssnano-plugin" : " ^1.0.5" ,
2727 "@soda/friendly-errors-webpack-plugin" : " ^1.7.1" ,
28+ "@soda/get-current-script" : " ^1.0.0" ,
2829 "@vue/cli-overlay" : " ^4.2.3" ,
2930 "@vue/cli-plugin-router" : " ^4.2.3" ,
3031 "@vue/cli-plugin-vuex" : " ^4.2.3" ,
4546 "copy-webpack-plugin" : " ^5.1.1" ,
4647 "css-loader" : " ^3.4.2" ,
4748 "cssnano" : " ^4.1.10" ,
48- "current-script-polyfill" : " ^1.0.0" ,
4949 "debug" : " ^4.1.1" ,
5050 "default-gateway" : " ^5.0.5" ,
5151 "dotenv" : " ^8.2.0" ,
Original file line number Diff line number Diff line change 23062306 error-stack-parser "^2.0.0"
23072307 string-width "^2.0.0"
23082308
2309+ "@soda/get-current-script@^1.0.0":
2310+ version "1.0.0"
2311+ resolved "https://registry.yarnpkg.com/@soda/get-current-script/-/get-current-script-1.0.0.tgz#623aa40623550e3b94767cffeb096a6fb597ed09"
2312+ integrity sha512-9GvTek+7cVw7r+L7TNGOG1astZJWXz2h5q4BqMXl28KN+24iSCm1xo+RhZOZvwdT3bzNe9hD7riJc/lBoO7mgg==
2313+
23092314"@szmarczak/http-timer@^1.1.2":
23102315 version "1.1.2"
23112316 resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
@@ -6317,11 +6322,6 @@ csv-parser@^1.6.0:
63176322 minimist "^1.2.0"
63186323 ndjson "^1.4.0"
63196324
6320- current-script-polyfill@^1.0.0:
6321- version "1.0.0"
6322- resolved "https://registry.yarnpkg.com/current-script-polyfill/-/current-script-polyfill-1.0.0.tgz#f31cf7e4f3e218b0726e738ca92a02d3488ef615"
6323- integrity sha1-8xz35PPiGLBybnOMqSoC00iO9hU=
6324-
63256325currently-unhandled@^0.4.1:
63266326 version "0.4.1"
63276327 resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"
You can’t perform that action at this time.
0 commit comments