Skip to content

Commit

Permalink
fix: publicPath function examples filename should include [path]
Browse files Browse the repository at this point in the history
To demonstrate why the dynamic relative path is necessary.
  • Loading branch information
karlvr committed Apr 5, 2019
1 parent fab158d commit 22efab1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -90,9 +90,9 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
plugins: [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
// Filename includes [path] so we use the publicPath function (below) to dynamically
// create publicPath relative to the source CSS file.
filename: "[path]/[name].css",
chunkFilename: "[id].css"
})
],
Expand Down
2 changes: 1 addition & 1 deletion test/cases/function-publicpath/webpack.config.js
Expand Up @@ -29,7 +29,7 @@ module.exports = {
},
plugins: [
new Self({
filename: '[name].css',
filename: '[path]/[name].css',
}),
],
};

0 comments on commit 22efab1

Please sign in to comment.