File tree Expand file tree Collapse file tree 11 files changed +104
-1
lines changed Expand file tree Collapse file tree 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) {
4444 const childFilename = '*' ;
4545 const publicPath =
4646 typeof options . publicPath === 'string'
47- ? options . publicPath === '' || options . publicPath . endsWith ( '/' )
47+ ? options . publicPath === 'auto'
48+ ? ''
49+ : options . publicPath === '' || options . publicPath . endsWith ( '/' )
4850 ? options . publicPath
4951 : `${ options . publicPath } /`
5052 : typeof options . publicPath === 'function'
5153 ? options . publicPath ( this . resourcePath , this . rootContext )
54+ : this . _compilation . outputOptions . publicPath === 'auto'
55+ ? ''
5256 : this . _compilation . outputOptions . publicPath ;
57+
5358 const outputOptions = {
5459 filename : childFilename ,
5560 publicPath,
5661 } ;
62+
5763 const childCompiler = this . _compilation . createChildCompiler (
5864 `${ pluginName } ${ request } ` ,
5965 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+ }
You can’t perform that action at this time.
0 commit comments