Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* @file database drop script.
* @author Sebastian Siemssen
* @date 2016-06-21
*/
import mongoose from 'mongoose';
// Load the environment configuration.
require('dotenv-extended').config({
path : '.env.local',
defaults : '.env',
});
// Use promises for mongoose async operations.
mongoose.Promise = Promise;
/**
* drop database
*
* @desc main entry point for this script
* @return {null}
*/
const dropDatabase = () => {
console.log('Starting to drop the entire database.');
/**
* @file production webpack config
* @author Sebastian Siemssen
* @date 2016-01-01
*/
/* eslint-disable global-require */
// Load the environment configuration.
require('dotenv-extended').config(
{
path : '.env.local',
defaults : '.env',
}
);
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const OfflinePlugin = require('offline-plugin');
const WebpackMd5Hash = require('webpack-md5-hash');
const gitRevSync = require('git-rev-sync');
module.exports = [require('./webpack.base')({
// In production, we skip all hot-reloading stuff.
/**
* @file node express server
* @author Sebastian Siemssen
* @date 2016-01-01
*/
/* eslint-disable global-require */
/* eslint-disable consistent-return */
// Load the polyfill so we can use things like Object.values().
import 'babel-polyfill';
// Load the environment configuration.
require('dotenv-extended').config({
path : '.env.local',
defaults : '.env',
});
// Fix error "Warning: Possible EventEmitter memory leak detected.".
require('events').EventEmitter.prototype._maxListeners = 200; // eslint-disable-line no-underscore-dangle
import compression from 'compression';
import express from 'express';
import graphql from 'express-graphql';
import mongoose from 'mongoose';
import schema from './schema';
// Use promises for mongoose async operations.
mongoose.Promise = Promise;
/**
* @file develop webpack config
* @author Sebastian Siemssen
* @date 2016-01-01
*/
/* eslint-disable global-require */
// Load the environment configuration.
require('dotenv-extended').config(
{
path : '.env.local',
defaults : '.env',
}
);
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const dependencyHandlers = () => {
const dllPath = path.resolve(process.cwd(), 'dlls');
const manifestPath = path.resolve(dllPath, 'dependencies.json');