diff --git a/test/cases/publicpath-function/expected/main.css b/test/cases/publicpath-function/expected/nested/style.css similarity index 100% rename from test/cases/publicpath-function/expected/main.css rename to test/cases/publicpath-function/expected/nested/style.css diff --git a/test/cases/publicpath-function/webpack.config.js b/test/cases/publicpath-function/webpack.config.js index 30b243df..948b9db6 100644 --- a/test/cases/publicpath-function/webpack.config.js +++ b/test/cases/publicpath-function/webpack.config.js @@ -2,7 +2,10 @@ const Self = require('../../../'); const path = require('path') module.exports = { - entry: './index.js', + entry: { + // Specific CSS entry point, with output to a nested folder + 'nested/style': './nested/style.css', + }, module: { rules: [ { @@ -11,6 +14,7 @@ module.exports = { { loader: Self.loader, options: { + // Compute publicPath relative to the CSS output publicPath: (resourcePath, context) => path.relative(path.dirname(resourcePath), context) + '/', } },