2017-05-12 00:23:56 +00:00
|
|
|
/* eslint-disable */
|
2016-09-15 03:50:59 +00:00
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
2016-02-27 21:53:11 +00:00
|
|
|
|
2017-02-10 05:55:36 +00:00
|
|
|
require('dotenv').config({ silent: true });
|
2016-02-27 21:53:11 +00:00
|
|
|
|
2016-09-15 03:50:59 +00:00
|
|
|
const definePlugin = new webpack.DefinePlugin({
|
2016-05-24 05:20:16 +00:00
|
|
|
__DEV__: JSON.stringify(JSON.parse(process.env.NODE_ENV !== 'production')),
|
2017-04-28 05:10:43 +00:00
|
|
|
__PRERELEASE__: JSON.stringify(
|
|
|
|
JSON.parse(process.env.BUILD_PRERELEASE || 'false')
|
|
|
|
),
|
2016-07-26 05:49:32 +00:00
|
|
|
SLACK_REDIRECT_URI: JSON.stringify(process.env.SLACK_REDIRECT_URI),
|
|
|
|
SLACK_KEY: JSON.stringify(process.env.SLACK_KEY),
|
2017-05-12 00:23:56 +00:00
|
|
|
BASE_URL: JSON.stringify(process.env.URL),
|
2016-10-14 20:08:25 +00:00
|
|
|
DEPLOYMENT: JSON.stringify(process.env.DEPLOYMENT || 'hosted'),
|
2016-02-27 21:53:11 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
filename: 'bundle.js',
|
2016-09-15 03:50:59 +00:00
|
|
|
publicPath: '/static/',
|
2016-02-27 21:53:11 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
loader: 'babel',
|
2017-07-29 23:15:04 +00:00
|
|
|
include: [
|
|
|
|
path.join(__dirname, 'frontend'),
|
|
|
|
path.join(__dirname, 'shared'),
|
2017-09-10 20:27:15 +00:00
|
|
|
],
|
2016-02-27 21:53:11 +00:00
|
|
|
},
|
|
|
|
{ test: /\.json$/, loader: 'json-loader' },
|
2016-09-15 03:50:59 +00:00
|
|
|
// inline base64 URLs for <=8k images, direct URLs for the rest
|
|
|
|
{ test: /\.(png|jpg|svg)$/, loader: 'url-loader' },
|
2016-05-04 06:43:43 +00:00
|
|
|
{
|
|
|
|
test: /\.woff$/,
|
2016-09-15 03:50:59 +00:00
|
|
|
loader: 'url-loader?limit=1&mimetype=application/font-woff&name=public/fonts/[name].[ext]',
|
2016-05-04 06:43:43 +00:00
|
|
|
},
|
2017-09-10 20:27:15 +00:00
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
loader: 'style-loader!css-loader?sourceMap',
|
|
|
|
},
|
2017-05-12 00:23:56 +00:00
|
|
|
{ test: /\.md/, loader: 'raw-loader' },
|
2016-09-15 03:50:59 +00:00
|
|
|
],
|
2017-07-16 18:47:48 +00:00
|
|
|
// Silence warning https://github.com/localForage/localForage/issues/599
|
|
|
|
noParse: [new RegExp('node_modules/localforage/dist/localforage.js')],
|
2016-02-27 21:53:11 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
2016-07-24 22:32:31 +00:00
|
|
|
root: path.join(__dirname, 'frontend'),
|
2016-02-27 21:53:11 +00:00
|
|
|
// you can now require('file') instead of require('file.json')
|
2016-09-15 03:50:59 +00:00
|
|
|
extensions: ['', '.js', '.json'],
|
2016-02-27 21:53:11 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
definePlugin,
|
|
|
|
new webpack.ProvidePlugin({
|
2016-09-15 03:50:59 +00:00
|
|
|
fetch: 'imports?this=>global!exports?global.fetch!isomorphic-fetch',
|
2016-02-27 21:53:11 +00:00
|
|
|
}),
|
2016-09-15 03:50:59 +00:00
|
|
|
new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en)$/),
|
2017-07-11 04:47:02 +00:00
|
|
|
new webpack.IgnorePlugin(/unicode\/category\/So/),
|
2016-06-05 01:28:14 +00:00
|
|
|
],
|
2016-08-27 20:18:46 +00:00
|
|
|
stats: {
|
|
|
|
assets: false,
|
|
|
|
},
|
2016-07-24 22:32:31 +00:00
|
|
|
};
|