Skip to content

Commit 85643bb

Browse files
committed
test(loader): Add test for the case when publicPath is an empty string
1 parent 8ae0739 commit 85643bb

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
body { background: red; background-image: url(cd0bb358c45b584743d8ce4991777c42.svg); }
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './style.css';
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
body { background: red; background-image: url(./react.svg); }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import Self from '../../../src';
2+
3+
module.exports = {
4+
entry: './index.js',
5+
module: {
6+
rules: [
7+
{
8+
test: /\.css$/,
9+
use: [
10+
{
11+
loader: Self.loader,
12+
options: {
13+
publicPath: '',
14+
},
15+
},
16+
'css-loader',
17+
],
18+
},
19+
{
20+
test: /\.(svg|png)$/,
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+
};

0 commit comments

Comments
 (0)