Skip to content

Commit 22efab1

Browse files
committed
fix: publicPath function examples filename should include [path]
To demonstrate why the dynamic relative path is necessary.
1 parent fab158d commit 22efab1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
9090
module.exports = {
9191
plugins: [
9292
new MiniCssExtractPlugin({
93-
// Options similar to the same options in webpackOptions.output
94-
// both options are optional
95-
filename: "[name].css",
93+
// Filename includes [path] so we use the publicPath function (below) to dynamically
94+
// create publicPath relative to the source CSS file.
95+
filename: "[path]/[name].css",
9696
chunkFilename: "[id].css"
9797
})
9898
],

test/cases/function-publicpath/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
},
3030
plugins: [
3131
new Self({
32-
filename: '[name].css',
32+
filename: '[path]/[name].css',
3333
}),
3434
],
3535
};

0 commit comments

Comments
 (0)