File tree 3 files changed +29
-4
lines changed
Filter options
3 files changed +29
-4
lines changed
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ export default function loader(
79
79
sourceMap,
80
80
rootContext,
81
81
resourcePath,
82
- resourceQuery,
82
+ resourceQuery = '' ,
83
83
} = loaderContext
84
84
85
85
const rawQuery = resourceQuery . slice ( 1 )
Original file line number Diff line number Diff line change @@ -169,7 +169,10 @@ class VueLoaderPlugin implements Plugin {
169
169
// rule for template compiler
170
170
const templateCompilerRule = {
171
171
loader : require . resolve ( './templateLoader' ) ,
172
- resourceQuery : ( query : string ) => {
172
+ resourceQuery : ( query ?: string ) => {
173
+ if ( ! query ) {
174
+ return false
175
+ }
173
176
const parsed = qs . parse ( query . slice ( 1 ) )
174
177
return parsed . vue != null && parsed . type === 'template'
175
178
} ,
@@ -188,7 +191,10 @@ class VueLoaderPlugin implements Plugin {
188
191
// post loader)
189
192
const pitcher = {
190
193
loader : require . resolve ( './pitcher' ) ,
191
- resourceQuery : ( query : string ) => {
194
+ resourceQuery : ( query ?: string ) => {
195
+ if ( ! query ) {
196
+ return false
197
+ }
192
198
const parsed = qs . parse ( query . slice ( 1 ) )
193
199
return parsed . vue != null
194
200
} ,
@@ -276,7 +282,11 @@ function cloneRule(
276
282
currentResource = resources
277
283
return true
278
284
} ,
279
- resourceQuery : ( query : string ) => {
285
+ resourceQuery : ( query ?: string ) => {
286
+ if ( ! query ) {
287
+ return false
288
+ }
289
+
280
290
const parsed = qs . parse ( query . slice ( 1 ) )
281
291
if ( parsed . vue == null ) {
282
292
return false
Original file line number Diff line number Diff line change 1
1
import * as path from 'path'
2
+ import webpack = require( 'webpack' )
2
3
import HTMLPlugin = require( 'html-webpack-plugin' )
3
4
import { mfs , bundle , mockBundleAndRun , normalizeNewline } from './utils'
4
5
@@ -181,3 +182,17 @@ test('use with postLoader', async () => {
181
182
} )
182
183
assertComponent ( Object . assign ( { expectedMsg : 'Changed!' } , result ) )
183
184
} )
185
+
186
+ // #1771
187
+ test ( 'data: URI as entry' , async ( ) => {
188
+ // this feature is only available in webpack 5
189
+ if ( webpack . version ! . startsWith ( '4' ) ) {
190
+ return
191
+ }
192
+
193
+ await bundle ( {
194
+ entry : {
195
+ main : 'data:text/javascript,console.log("hello world")' ,
196
+ } ,
197
+ } )
198
+ } )
You can’t perform that action at this time.
0 commit comments