Skip to content

Commit

Permalink
Solves pull request #68
Browse files Browse the repository at this point in the history
  • Loading branch information
catamphetamine committed Apr 14, 2016
1 parent 3bbfbcb commit ec242c7
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions source/plugin/plugin.js
Expand Up @@ -205,9 +205,26 @@ Webpack_isomorphic_tools_plugin.style_loader_filter = function(module, regular_e
{
const css_loader = module.name.split('!')[0]
return regular_expression.test(module.name) &&
(css_loader.indexOf('./~/css-loader') === 0 ||
css_loader.indexOf('./~/.npminstall/css-loader') === 0 ||
css_loader.indexOf('./~/.store/css-loader') === 0)
// The paths below have the form of "/~/css-loader"
// and not the form of "./~/css-loader"
// because in some (non-standard) cases
// Webpack project context can be set
// not to project root folder.
//
// For a discussion see:
// https://github.com/halt-hammerzeit/webpack-isomorphic-tools/pull/68
// (there the `context` is set to the "${project_root}/src" folder
// so that the asset paths in `webpack-assets.json` wouldn't
// contain the "./src" prefix and therefore they will be found
// when require()d from code in "./target"
// which is compiled with Babel from the "./src" folder)
//
// I personally don't compile sources on the server side,
// so I haven't thought of better ways of doing all that.
//
(css_loader.indexOf('/~/css-loader') > 0 ||
css_loader.indexOf('/~/.npminstall/css-loader') > 0 ||
css_loader.indexOf('/~/.store/css-loader') > 0)
}

// extracts css style file path
Expand Down

0 comments on commit ec242c7

Please sign in to comment.