Created
June 1, 2019 21:51
-
-
Save mauriciofierrom/ab71338f67906737bb274207d3df1e6d to your computer and use it in GitHub Desktop.
Webpack configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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