Newer
Older
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const webpack = require('webpack')
const apiUrl = typeof process.env.API_URL !== 'undefined' ? process.env.API_URL : 'http://localhost:3001/api/v1'
},
plugins: [
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin({
// Load a custom template
template: 'src/client/index.html',
favicon: 'src/client/favicon.ico'
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env.API_URL': JSON.stringify(apiUrl)
})
],
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, outputDirectory),