Skip to content

Commit

Permalink
update webpack css include path, allow files to be loaded from the pr…
Browse files Browse the repository at this point in the history
…oject root node_modules folder. (#178)
  • Loading branch information
breaddevil authored and gaearon committed Jul 25, 2016
1 parent 90d49f8 commit d69ee27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (isInDebugMode) {
relativePath = '../template';
}
var srcPath = path.resolve(__dirname, relativePath, 'src');
var rootNodeModulesPath = path.resolve(__dirname, relativePath, 'node_modules');
var nodeModulesPath = path.join(__dirname, '..', 'node_modules');
var indexHtmlPath = path.resolve(__dirname, relativePath, 'index.html');
var faviconPath = path.resolve(__dirname, relativePath, 'favicon.ico');
Expand Down Expand Up @@ -67,7 +68,7 @@ module.exports = {
},
{
test: /\.css$/,
include: [srcPath, nodeModulesPath],
include: [srcPath, rootNodeModulesPath],
loader: 'style!css!postcss'
},
{
Expand Down
3 changes: 2 additions & 1 deletion config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if (process.argv[2] === '--debug-template') {
relativePath = '../template';
}
var srcPath = path.resolve(__dirname, relativePath, 'src');
var rootNodeModulesPath = path.resolve(__dirname, relativePath, 'node_modules');
var nodeModulesPath = path.join(__dirname, '..', 'node_modules');
var indexHtmlPath = path.resolve(__dirname, relativePath, 'index.html');
var faviconPath = path.resolve(__dirname, relativePath, 'favicon.ico');
Expand Down Expand Up @@ -68,7 +69,7 @@ module.exports = {
},
{
test: /\.css$/,
include: [srcPath, nodeModulesPath],
include: [srcPath, rootNodeModulesPath],
// Disable autoprefixer in css-loader itself:
// https://github.com/webpack/css-loader/issues/281
// We already have it thanks to postcss.
Expand Down

0 comments on commit d69ee27

Please sign in to comment.