Skip to content

Commit d69ee27

Browse files
breaddevilgaearon
authored andcommitted
update webpack css include path, allow files to be loaded from the project root node_modules folder. (#178)
1 parent 90d49f8 commit d69ee27

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

config/webpack.config.dev.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ if (isInDebugMode) {
2424
relativePath = '../template';
2525
}
2626
var srcPath = path.resolve(__dirname, relativePath, 'src');
27+
var rootNodeModulesPath = path.resolve(__dirname, relativePath, 'node_modules');
2728
var nodeModulesPath = path.join(__dirname, '..', 'node_modules');
2829
var indexHtmlPath = path.resolve(__dirname, relativePath, 'index.html');
2930
var faviconPath = path.resolve(__dirname, relativePath, 'favicon.ico');
@@ -67,7 +68,7 @@ module.exports = {
6768
},
6869
{
6970
test: /\.css$/,
70-
include: [srcPath, nodeModulesPath],
71+
include: [srcPath, rootNodeModulesPath],
7172
loader: 'style!css!postcss'
7273
},
7374
{

config/webpack.config.prod.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ if (process.argv[2] === '--debug-template') {
2323
relativePath = '../template';
2424
}
2525
var srcPath = path.resolve(__dirname, relativePath, 'src');
26+
var rootNodeModulesPath = path.resolve(__dirname, relativePath, 'node_modules');
2627
var nodeModulesPath = path.join(__dirname, '..', 'node_modules');
2728
var indexHtmlPath = path.resolve(__dirname, relativePath, 'index.html');
2829
var faviconPath = path.resolve(__dirname, relativePath, 'favicon.ico');
@@ -68,7 +69,7 @@ module.exports = {
6869
},
6970
{
7071
test: /\.css$/,
71-
include: [srcPath, nodeModulesPath],
72+
include: [srcPath, rootNodeModulesPath],
7273
// Disable autoprefixer in css-loader itself:
7374
// https://github.com/webpack/css-loader/issues/281
7475
// We already have it thanks to postcss.

0 commit comments

Comments
 (0)