Added api, keyboard shortcut flatpages

This commit is contained in:
Jori Lallo
2016-09-14 20:50:59 -07:00
parent aed9c9ce90
commit 45b21f365d
13 changed files with 215 additions and 13 deletions

View File

@ -1,10 +1,10 @@
var path = require('path');
var webpack = require('webpack');
const path = require('path');
const webpack = require('webpack');
// Load .env
require('dotenv').config();
var definePlugin = new webpack.DefinePlugin({
const definePlugin = new webpack.DefinePlugin({
__DEV__: JSON.stringify(JSON.parse(process.env.NODE_ENV !== 'production')),
__PRERELEASE__: JSON.stringify(JSON.parse(process.env.BUILD_PRERELEASE || 'false')),
SLACK_REDIRECT_URI: JSON.stringify(process.env.SLACK_REDIRECT_URI),
@ -16,41 +16,43 @@ module.exports = {
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
publicPath: '/static/',
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
include: path.join(__dirname, 'frontend')
include: path.join(__dirname, 'frontend'),
},
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.(png|jpg|svg)$/, loader: 'url-loader' }, // inline base64 URLs for <=8k images, direct URLs for the rest
// inline base64 URLs for <=8k images, direct URLs for the rest
{ test: /\.(png|jpg|svg)$/, loader: 'url-loader' },
{
test: /\.woff$/,
loader: 'url-loader?limit=1&mimetype=application/font-woff&name=public/fonts/[name].[ext]'
loader: 'url-loader?limit=1&mimetype=application/font-woff&name=public/fonts/[name].[ext]',
},
{ test: /\.markdown/, loader: 'raw-loader' },
// Excludes
{
// slug
test: /unicode/,
loader: 'ignore-loader',
}
]
},
],
},
resolve: {
root: path.join(__dirname, 'frontend'),
// you can now require('file') instead of require('file.json')
extensions: ['', '.js', '.json']
extensions: ['', '.js', '.json'],
},
plugins: [
definePlugin,
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!isomorphic-fetch'
fetch: 'imports?this=>global!exports?global.fetch!isomorphic-fetch',
}),
new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en)$/)
new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en)$/),
],
stats: {
assets: false,