Skip to content

Instantly share code, notes, and snippets.

@mauriciofierrom
Created June 1, 2019 21:51
Show Gist options
  • Save mauriciofierrom/ab71338f67906737bb274207d3df1e6d to your computer and use it in GitHub Desktop.
Save mauriciofierrom/ab71338f67906737bb274207d3df1e6d to your computer and use it in GitHub Desktop.
Webpack configuration
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const outputDir = path.join(__dirname, 'build/');
const isProd = process.env.NODE_ENV === 'production';
module.exports = {
entry: './src/Index.bs.js',
target: 'electron-main',
mode: isProd ? 'production' : 'development',
output: {
path: outputDir,
filename: 'Index.js'
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html',
inject: false
})
],
devServer: {
compress: true,
contentBase: outputDir,
port: process.env.PORT || 8000,
historyApiFallback: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment