Skip to content

Commit

Permalink
Fix npm run build when using webpack 1.12.15
Browse files Browse the repository at this point in the history
'remote' module is used in electron-connect but it's removed from electron target on webpack 1.12.15.
So define 'remote' as "externals" to avoid bundling error.

http://webpack.github.io/docs/configuration.html#externals
  • Loading branch information
yuya-oc committed Apr 13, 2016
1 parent 0f89418 commit cc2d65c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ gulp.task('webpack:browser', function() {
__filename: false,
__dirname: false
},
target: 'electron'
target: 'electron-renderer'
}))
.pipe(gulp.dest('dist/browser/'));
});
Expand All @@ -128,7 +128,10 @@ gulp.task('webpack:main', function() {
__filename: false,
__dirname: false
},
target: 'electron'
target: 'electron-main',
externals: {
remote: true // for electron-connect
}
}))
.pipe(gulp.dest('dist/'));
});
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"babel-preset-react": "^6.3.13",
"chromedriver": "^2.20.0",
"del": "^2.2.0",
"electron-connect": "^0.3.3",
"electron-connect": "^0.3.7",
"electron-packager": "^5.1.0",
"electron-prebuilt": "0.36.11",
"esformatter": "^0.8.1",
Expand All @@ -48,6 +48,7 @@
"through2": "^2.0.1",
"vinyl-named": "^1.1.0",
"webdriverio": "^3.3.0",
"webpack": "^1.12.15",
"webpack-stream": "^3.1.0"
}
}

0 comments on commit cc2d65c

Please sign in to comment.