dc801ccf7f
* Higher-order component to force some routes to HTTPS * Force all user-management routes to HTTPS * Redirect to sourceProtocol as route unmounts. By default, no redirection occurs if sourceProtocol is not explicitly defined. * Sets serveSecure flag on new projects and usea after forcing protocol The flag is set to `false` on all projects and as the UI has no way to change this, it always redirects to HTTP after a signup/login action. * Move HoC to be with other top-level components * Server should respond to account page request * Serves AccountView over HTTPS * Turns HTTPS redirection off in development by default Will log to the browser console any redirection that would have happened. Added a line in the README about how to enable this for testing in development.
68 lines
1.5 KiB
JavaScript
68 lines
1.5 KiB
JavaScript
var webpack = require('webpack');
|
|
require('dotenv').config();
|
|
|
|
module.exports = {
|
|
devtool: 'cheap-module-eval-source-map',
|
|
entry: {
|
|
app: ['babel-polyfill',
|
|
'webpack-hot-middleware/client',
|
|
'./client/index.jsx',
|
|
],
|
|
vendor: [
|
|
'react',
|
|
'react-dom'
|
|
]
|
|
},
|
|
output: {
|
|
path: __dirname + '/dist/',
|
|
filename: 'app.js',
|
|
publicPath: '/dist/'
|
|
},
|
|
resolve: {
|
|
extensions: ['', '.js', '.jsx'],
|
|
modules: [
|
|
'client',
|
|
'node_modules'
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new webpack.optimize.CommonsChunkPlugin({
|
|
name: 'vendor',
|
|
minChunks: Infinity,
|
|
filename: 'vendor.js',
|
|
}),
|
|
new webpack.DefinePlugin({
|
|
'process.env': {
|
|
API_URL: '"' + process.env.API_URL + '"',
|
|
CLIENT: JSON.stringify(true),
|
|
FORCE_TO_HTTPS: process.env.FORCE_TO_HTTPS === 'true' ?
|
|
JSON.stringify(true) :
|
|
JSON.stringify(false),
|
|
'NODE_ENV': JSON.stringify('development'),
|
|
'S3_BUCKET': '"' + process.env.S3_BUCKET + '"'
|
|
}
|
|
})
|
|
],
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.jsx?$/,
|
|
exclude: [/node_modules/, /.+\.config.js/],
|
|
loaders: ['babel', 'eslint-loader']
|
|
},
|
|
{
|
|
test: /\.scss$/,
|
|
loaders: ['style', 'css', 'sass']
|
|
},
|
|
{
|
|
test: /\.(svg|mp3)$/,
|
|
loader: 'file'
|
|
},
|
|
{
|
|
test: /fonts\/.*\.(eot|svg|ttf|woff|woff2)$/,
|
|
loader: 'file'
|
|
}
|
|
],
|
|
},
|
|
};
|