app/config/webpack.config.renderer.js
crusader 8f4d7ec895 ing
2018-08-15 20:14:23 +09:00

30 lines
694 B
JavaScript

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