2018-08-14 12:26:23 +00:00
|
|
|
var fse = require('fs-extra');
|
|
|
|
const util = require('util');
|
|
|
|
|
2018-08-15 11:14:23 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
|
|
|
|
const { getReplacements } = require('./app-info');
|
|
|
|
|
|
|
|
const replacements = getReplacements();
|
|
|
|
|
|
|
|
module.exports = function (config) {
|
2018-08-14 12:26:23 +00:00
|
|
|
config.target = 'electron-renderer';
|
2018-08-15 11:14:23 +00:00
|
|
|
|
|
|
|
config.plugins.push(
|
|
|
|
new webpack.DefinePlugin(
|
|
|
|
Object.assign({}, replacements, {
|
|
|
|
__PROCESS_KIND__: JSON.stringify('renderer'),
|
|
|
|
})
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2018-08-14 12:26:23 +00:00
|
|
|
// console.log(config.module);
|
|
|
|
// console.log(util.inspect(config.module, {showHidden: false, depth: null}));
|
|
|
|
|
2018-08-15 11:14:23 +00:00
|
|
|
var json = util.inspect(config, { showHidden: false, depth: null });
|
|
|
|
fse.writeFileSync('webpack.js', json, 'utf8');
|
2018-08-14 12:26:23 +00:00
|
|
|
|
|
|
|
return config;
|
|
|
|
};
|