File tree 12 files changed +105
-2
lines changed
12 files changed +105
-2
lines changed Original file line number Diff line number Diff line change 31
31
"test:only" : " cross-env NODE_ENV=test jest" ,
32
32
"test:watch" : " npm run test:only -- --watch" ,
33
33
"test:coverage" : " npm run test:only -- --collectCoverageFrom=\" src/**/*.js\" --coverage" ,
34
- "test:manual" : " npm run build && webpack-dev-server test/manual/src/index.js --open --config test/manual/webpack.config.js" ,
34
+ "test:manual" : " npm run build && webpack serve ./ test/manual/src/index.js --open --config ./ test/manual/webpack.config.js" ,
35
35
"pretest" : " npm run lint" ,
36
36
"test" : " cross-env NODE_ENV=test npm run test:coverage" ,
37
37
"defaults" : " webpack-defaults"
Original file line number Diff line number Diff line change @@ -50,16 +50,22 @@ export function pitch(request) {
50
50
const childFilename = '*' ;
51
51
const publicPath =
52
52
typeof options . publicPath === 'string'
53
- ? options . publicPath === '' || options . publicPath . endsWith ( '/' )
53
+ ? options . publicPath === 'auto'
54
+ ? ''
55
+ : options . publicPath === '' || options . publicPath . endsWith ( '/' )
54
56
? options . publicPath
55
57
: `${ options . publicPath } /`
56
58
: typeof options . publicPath === 'function'
57
59
? options . publicPath ( this . resourcePath , this . rootContext )
60
+ : this . _compilation . outputOptions . publicPath === 'auto'
61
+ ? ''
58
62
: this . _compilation . outputOptions . publicPath ;
63
+
59
64
const outputOptions = {
60
65
filename : childFilename ,
61
66
publicPath,
62
67
} ;
68
+
63
69
const childCompiler = this . _compilation . createChildCompiler (
64
70
`${ pluginName } ${ request } ` ,
65
71
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