This commit is contained in:
crusader
2018-09-27 18:44:56 +09:00
parent 89abe15b4b
commit e925485135
12 changed files with 45 additions and 35 deletions

View File

@@ -10,6 +10,7 @@ const channel = getReleaseChannel();
const s = JSON.stringify;
function getReplacements() {
console.log(`channel: ${channel}`);
return {
__DARWIN__: process.platform === 'darwin',
__WIN32__: process.platform === 'win32',

View File

@@ -22,7 +22,7 @@ module.exports = function () {
let config = Object.assign({});
config.target = 'electron-main';
config.mode = PROD ? 'production' : 'development';
config.devtool = PROD ? 'source-map' : 'cheap-module-source-map';
config.devtool = PROD ? false : 'cheap-module-source-map';
config.externals = [nodeExternals()];
config.entry = {
'index': root('src', 'electron', 'main.ts')

View File

@@ -13,12 +13,11 @@ const PROD = EVENT.includes('prod');
module.exports = function (config) {
config.target = 'electron-renderer';
// config.output = {
// path: PROD ? root('build', 'dist') : root('build', 'dev'),
// filename: '[name].js',
// sourceMapFilename: '[file].map',
// };
config.output = {
path: PROD ? root('build', 'dist') : root('build', 'dev'),
filename: '[name].js',
crossOriginLoading: false,
};
config.plugins.push(
new webpack.DefinePlugin(