Skip to content

Commit c836404

Browse files
author
benholloway
committed
placed preference on nested node_modules over those in the root project to support npm-link'd projects, bump minor version
1 parent 3ccb2bc commit c836404

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

config/add/common.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ function common(loaderRoot, options) {
1919
/* jshint validthis:true */
2020
var vendorEntry = path.resolve(options.appDir, 'vendor.js');
2121

22+
// Note that DedupePlugin causes problems when npm linked so we will ommit it from the common configuration
23+
// you need to add it yourself if you wish to use it
24+
// https://github.com/webpack/karma-webpack/issues/41#issuecomment-139516692
25+
2226
return this
2327
.merge({
2428
context : process.cwd(),
@@ -34,15 +38,14 @@ function common(loaderRoot, options) {
3438
devtoolFallbackModuleFilenameTemplate: '[resource-path]?[hash]'
3539
},
3640
resolve : {
37-
alias : {
38-
npm: path.resolve('node_modules')
39-
},
40-
root : path.resolve('node_modules'),
41-
fallback: path.resolve('bower_components')
41+
// do not use root as we want node_modules in linked projects to take precedence
42+
modulesDirectories: ['node_modules', 'bower_components'],
43+
fallback : [path.resolve('node_modules'), path.resolve('bower_components')]
4244
},
4345
resolveLoader: {
44-
root : loaderRoot,
45-
fallback: path.resolve('node_modules')
46+
// do not use root as we want node_modules in linked projects to take precedence
47+
modulesDirectories: ['node_modules'],
48+
fallback : [loaderRoot, path.resolve('node_modules')]
4649
},
4750
node : {
4851
fs: 'empty'
@@ -145,7 +148,6 @@ function common(loaderRoot, options) {
145148
name : 'vendor',
146149
minChunks: Infinity
147150
}])
148-
.plugin('dedupe', webpack.optimize.DedupePlugin)
149151
.plugin('occurence-order', webpack.optimize.OccurenceOrderPlugin);
150152
}
151153

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack-angularity-solution",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"description": "Requisite configuration and modules to build Angularity projects with Webpack",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)