Fix npm run build when using webpack 1.12.15

'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
This commit is contained in:
Yuya Ochiai
2016-04-13 23:34:50 +09:00
parent 0f89418fb0
commit cc2d65c741
2 changed files with 7 additions and 3 deletions

View File

@@ -107,7 +107,7 @@ gulp.task('webpack:browser', function() {
__filename: false,
__dirname: false
},
target: 'electron'
target: 'electron-renderer'
}))
.pipe(gulp.dest('dist/browser/'));
});
@@ -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/'));
});