Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(loader): Add test for the case when publicPath is an empty string
  • Loading branch information
rmja committed Apr 26, 2019
commit 0b4c737caa73a1a5924336c421f935a7748a6d1c
2 changes: 2 additions & 0 deletions test/cases/publicpath-emptystring/expected/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
body { background: red; background-image: url(cd0bb358c45b584743d8ce4991777c42.svg); }

1 change: 1 addition & 0 deletions test/cases/publicpath-emptystring/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './style.css';
1 change: 1 addition & 0 deletions test/cases/publicpath-emptystring/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/cases/publicpath-emptystring/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
body { background: red; background-image: url(./react.svg); }
37 changes: 37 additions & 0 deletions test/cases/publicpath-emptystring/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import Self from '../../../src';

module.exports = {
entry: './index.js',
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: Self.loader,
options: {
publicPath: '',
},
},
'css-loader',
],
},
{
test: /\.(svg|png)$/,
use: [
{
loader: 'file-loader',
options: {
filename: '[name].[ext]',
},
},
],
},
],
},
plugins: [
new Self({
filename: '[name].css',
}),
],
};