File tree 11 files changed +104
-1
lines changed
11 files changed +104
-1
lines changed Original file line number Diff line number Diff line change @@ -44,16 +44,22 @@ export function pitch(request) {
44
44
const childFilename = '*' ;
45
45
const publicPath =
46
46
typeof options . publicPath === 'string'
47
- ? options . publicPath === '' || options . publicPath . endsWith ( '/' )
47
+ ? options . publicPath === 'auto'
48
+ ? ''
49
+ : options . publicPath === '' || options . publicPath . endsWith ( '/' )
48
50
? options . publicPath
49
51
: `${ options . publicPath } /`
50
52
: typeof options . publicPath === 'function'
51
53
? options . publicPath ( this . resourcePath , this . rootContext )
54
+ : this . _compilation . outputOptions . publicPath === 'auto'
55
+ ? ''
52
56
: this . _compilation . outputOptions . publicPath ;
57
+
53
58
const outputOptions = {
54
59
filename : childFilename ,
55
60
publicPath,
56
61
} ;
62
+
57
63
const childCompiler = this . _compilation . createChildCompiler (
58
64
`${ pluginName } ${ request } ` ,
59
65
outputOptions
Original file line number Diff line number Diff line change
1
+ body {
2
+ background : red;
3
+ background-image : url (c9e192c015437a21dea1faa1d30f4941.svg);
4
+ }
5
+
Original file line number Diff line number Diff line change
1
+ import './style.css' ;
Original file line number Diff line number Diff line change
1
+ body {
2
+ background : red;
3
+ background-image : url (./ react.svg);
4
+ }
Original file line number Diff line number Diff line change
1
+ import Self from '../../../src' ;
2
+
3
+ module . exports = {
4
+ entry : './index.js' ,
5
+ output : {
6
+ publicPath : 'auto' ,
7
+ } ,
8
+ module : {
9
+ rules : [
10
+ {
11
+ test : / \. c s s $ / ,
12
+ use : [
13
+ {
14
+ loader : Self . loader ,
15
+ options : { } ,
16
+ } ,
17
+ 'css-loader' ,
18
+ ] ,
19
+ } ,
20
+ {
21
+ test : / \. ( s v g | p n g ) $ / ,
22
+ use : [
23
+ {
24
+ loader : 'file-loader' ,
25
+ options : {
26
+ filename : '[name].[ext]' ,
27
+ } ,
28
+ } ,
29
+ ] ,
30
+ } ,
31
+ ] ,
32
+ } ,
33
+ plugins : [
34
+ new Self ( {
35
+ filename : '[name].css' ,
36
+ } ) ,
37
+ ] ,
38
+ } ;
Original file line number Diff line number Diff line change
1
+ body {
2
+ background : red;
3
+ background-image : url (c9e192c015437a21dea1faa1d30f4941.svg);
4
+ }
5
+
Original file line number Diff line number Diff line change
1
+ import './style.css' ;
Original file line number Diff line number Diff line change
1
+ body {
2
+ background : red;
3
+ background-image : url (./ react.svg);
4
+ }
Original file line number Diff line number Diff line change
1
+ import Self from '../../../src' ;
2
+
3
+ module . exports = {
4
+ entry : './index.js' ,
5
+ module : {
6
+ rules : [
7
+ {
8
+ test : / \. c s s $ / ,
9
+ use : [
10
+ {
11
+ loader : Self . loader ,
12
+ options : {
13
+ publicPath : 'auto' ,
14
+ } ,
15
+ } ,
16
+ 'css-loader' ,
17
+ ] ,
18
+ } ,
19
+ {
20
+ test : / \. ( s v g | p n g ) $ / ,
21
+ use : [
22
+ {
23
+ loader : 'file-loader' ,
24
+ options : {
25
+ filename : '[name].[ext]' ,
26
+ } ,
27
+ } ,
28
+ ] ,
29
+ } ,
30
+ ] ,
31
+ } ,
32
+ plugins : [
33
+ new Self ( {
34
+ filename : '[name].css' ,
35
+ } ) ,
36
+ ] ,
37
+ } ;
You can’t perform that action at this time.
0 commit comments