Skip to content

Commit

Permalink
fix: publicpath-function test demonstrates purpose
Browse files Browse the repository at this point in the history
With output of the CSS into a nested folder the computation of the relative publicPath makes sense.
  • Loading branch information
karlvr committed Apr 5, 2019
1 parent 0f76012 commit 9ef1de0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion test/cases/publicpath-function/index.js

This file was deleted.

6 changes: 5 additions & 1 deletion test/cases/publicpath-function/webpack.config.js
Expand Up @@ -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: [
{
Expand All @@ -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) + '/',
}
},
Expand Down

0 comments on commit 9ef1de0

Please sign in to comment.