Skip to content

Commit 2f8fe6c

Browse files
committed
repro with webpack 5.22.0
0 parents  commit 2f8fe6c

File tree

8 files changed

+1152
-0
lines changed

8 files changed

+1152
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org/

package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "test-file-protocol",
3+
"version": "1.0.0",
4+
"main": "src/index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"build": "webpack"
8+
},
9+
"devDependencies": {
10+
"css-loader": "^6.3.0",
11+
"mini-css-extract-plugin": "^2.3.0",
12+
"webpack": "5.22.0",
13+
"webpack-cli": "^4.8.0"
14+
}
15+
}

src/cat.svg

+148
Loading

src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "./style.css";

src/style.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background-image: url(./cat.svg);
3+
}

webpack.config.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2+
3+
module.exports = {
4+
entry: './src/index.js',
5+
mode: 'production',
6+
7+
output: {
8+
publicPath: '/assets/',
9+
filename: '[name].[chunkhash].js',
10+
chunkFilename: '[name].[chunkhash].js',
11+
clean: true,
12+
},
13+
module: {
14+
rules: [
15+
{
16+
test: /\.css$/,
17+
use: [
18+
{
19+
loader: MiniCssExtractPlugin.loader,
20+
},
21+
'css-loader',
22+
],
23+
},
24+
{
25+
test: /\.svg$/,
26+
type: 'asset/resource',
27+
},
28+
],
29+
},
30+
plugins: [
31+
new MiniCssExtractPlugin({
32+
filename: '[name].css',
33+
}),
34+
],
35+
};

yarn.lock

+947
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)