This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/webpack.config.js

78 lines
2.2 KiB
JavaScript
Raw Normal View History

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')),
__PRERELEASE__: JSON.stringify(
JSON.parse(process.env.BUILD_PRERELEASE || 'false')
),
SLACK_APP_ID: JSON.stringify(process.env.SLACK_APP_ID),
2017-05-12 00:23:56 +00:00
BASE_URL: JSON.stringify(process.env.URL),
SENTRY_DSN: JSON.stringify(process.env.SENTRY_DSN),
2017-11-22 07:51:31 +00:00
'process.env': {
DEPLOYMENT: JSON.stringify(process.env.DEPLOYMENT),
2017-11-22 07:51:31 +00:00
URL: JSON.stringify(process.env.URL),
TEAM_LOGO: JSON.stringify(process.env.TEAM_LOGO),
2018-11-04 04:47:46 +00:00
SLACK_KEY: JSON.stringify(process.env.SLACK_KEY),
SUBDOMAINS_ENABLED: JSON.stringify(process.env.SUBDOMAINS_ENABLED === 'true'),
WEBSOCKETS_ENABLED: JSON.stringify(process.env.WEBSOCKETS_ENABLED === 'true')
2017-11-22 07:51:31 +00:00
}
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: {
2018-01-04 00:29:01 +00:00
rules: [
2016-02-27 21:53:11 +00:00
{
test: /\.js$/,
2018-01-04 00:29:01 +00:00
loader: 'babel-loader',
exclude: [
path.join(__dirname, 'node_modules')
],
include: [
2018-01-04 05:35:13 +00:00
path.join(__dirname, 'app'),
path.join(__dirname, 'shared'),
2018-05-31 18:42:39 +00:00
],
options: {
cacheDirectory: true
}
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' },
{
test: /\.woff$/,
2016-09-15 03:50:59 +00:00
loader: 'url-loader?limit=1&mimetype=application/font-woff&name=public/fonts/[name].[ext]',
},
2017-05-12 00:23:56 +00:00
{ test: /\.md/, loader: 'raw-loader' },
2018-11-10 07:40:33 +00:00
]
2016-02-27 21:53:11 +00:00
},
resolve: {
2018-01-04 00:29:01 +00:00
modules: [
2018-01-04 05:35:13 +00:00
path.resolve(__dirname, 'app'),
2018-01-04 00:29:01 +00:00
'node_modules'
],
2018-01-15 21:23:45 +00:00
mainFields: ["browser", "main"],
2018-01-04 00:29:01 +00:00
alias: {
2018-01-04 05:35:13 +00:00
shared: path.resolve(__dirname, 'shared'),
2018-01-04 00:29:01 +00:00
}
2016-02-27 21:53:11 +00:00
},
plugins: [
definePlugin,
new webpack.ProvidePlugin({
2018-01-04 00:29:01 +00:00
fetch: 'imports-loader?this=>global!exports-loader?global.fetch!isomorphic-fetch',
2016-02-27 21:53:11 +00:00
}),
2017-07-11 04:47:02 +00:00
new webpack.IgnorePlugin(/unicode\/category\/So/),
2016-06-05 01:28:14 +00:00
],
stats: {
assets: false,
},
2016-07-24 22:32:31 +00:00
};