Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
BigFatDog committed Jun 8, 2018
2 parents f96be36 + 33eb993 commit 5478ff1
Show file tree
Hide file tree
Showing 10 changed files with 21,397 additions and 14,992 deletions.
18 changes: 0 additions & 18 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,6 @@ import App from './routes';
// Import Language Provider
import LanguageProvider from './containers/LanguageProvider';

// Load the favicon, the manifest.json file and the .htaccess file
/* eslint-disable import/no-webpack-loader-syntax */
import '!file-loader?name=[name].[ext]!./images/favicon.ico';
import '!file-loader?name=[name].[ext]!./images/icon-72x72.png';
import '!file-loader?name=[name].[ext]!./images/icon-96x96.png';
import '!file-loader?name=[name].[ext]!./images/icon-120x120.png';
import '!file-loader?name=[name].[ext]!./images/icon-128x128.png';
import '!file-loader?name=[name].[ext]!./images/icon-144x144.png';
import '!file-loader?name=[name].[ext]!./images/icon-152x152.png';
import '!file-loader?name=[name].[ext]!./images/icon-167x167.png';
import '!file-loader?name=[name].[ext]!./images/icon-180x180.png';
import '!file-loader?name=[name].[ext]!./images/icon-192x192.png';
import '!file-loader?name=[name].[ext]!./images/icon-384x384.png';
import '!file-loader?name=[name].[ext]!./images/icon-512x512.png';
import '!file-loader?name=[name].[ext]!./manifest.json';
import 'file-loader?name=[name].[ext]!./.htaccess'; // eslint-disable-line import/extensions
/* eslint-enable import/no-webpack-loader-syntax */

import configureStore from './core/configureStore';

// Import i18n messages
Expand Down
4 changes: 2 additions & 2 deletions app/server/api/pubsub.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { addApolloLogging } from 'apollo-logger';
import { wrapPubSub } from 'apollo-logger';
import { PubSub } from 'graphql-subscriptions';

import settings from '../../../setting.json';

const pubsub = settings.apolloLogging
? addApolloLogging(new PubSub())
? wrapPubSub(new PubSub(), { logger: console.log })
: new PubSub();

export default pubsub;
15 changes: 0 additions & 15 deletions internals/templates/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@ import App from 'containers/App';
// Import Language Provider
import LanguageProvider from 'containers/LanguageProvider';

// Load the favicon, the manifest.json file and the .htaccess file
/* eslint-disable import/no-unresolved, import/extensions */
import '!file-loader?name=[name].[ext]!./images/favicon.ico';
import '!file-loader?name=[name].[ext]!./images/icon-72x72.png';
import '!file-loader?name=[name].[ext]!./images/icon-96x96.png';
import '!file-loader?name=[name].[ext]!./images/icon-128x128.png';
import '!file-loader?name=[name].[ext]!./images/icon-144x144.png';
import '!file-loader?name=[name].[ext]!./images/icon-152x152.png';
import '!file-loader?name=[name].[ext]!./images/icon-192x192.png';
import '!file-loader?name=[name].[ext]!./images/icon-384x384.png';
import '!file-loader?name=[name].[ext]!./images/icon-512x512.png';
import '!file-loader?name=[name].[ext]!./manifest.json';
import 'file-loader?name=[name].[ext]!./.htaccess';
/* eslint-enable import/no-unresolved, import/extensions */

import configureStore from './configureStore';

// Import i18n messages
Expand Down
42 changes: 31 additions & 11 deletions internals/webpack/webpack.base.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import webpack from 'webpack';
process.noDeprecation = true;

export default (options) => ({
mode: options.mode,
entry: options.entry,
output: Object.assign({ // Compile into js/build.js
path: path.resolve(process.cwd(), 'build'),
Expand Down Expand Up @@ -61,28 +62,51 @@ export default (options) => ({
}],
},
{
test: /\.(eot|svg|otf|ttf|woff|woff2)$/,
test: /\.(eot|otf|ttf|woff|woff2)$/,
use: 'file-loader',
},
{
test: /\.svg$/,
use: [
{
loader: 'svg-url-loader',
options: {
// Inline files smaller than 10 kB
limit: 10 * 1024,
noquotes: true,
},
},
],
},
{
test: /\.(jpg|png|gif)$/,
use: [
'file-loader',
{
loader: 'url-loader',
options: {
// Inline files smaller than 10 kB
limit: 10 * 1024,
},
},
{
loader: 'image-webpack-loader',
query: {
options: {
mozjpeg: {
progressive: true,
enabled: false,
// NOTE: mozjpeg is disabled as it causes errors in some Linux environments
// Try enabling it in your environment by switching the config to:
// enabled: true,
// progressive: true,
},
gifsicle: {
interlaced: false,
},
optipng: {
optimizationLevel: 4,
optimizationLevel: 7,
},
pngquant: {
quality: '75-90',
speed: 3,
quality: '65-90',
speed: 4,
},
},
},
Expand All @@ -92,10 +116,6 @@ export default (options) => ({
test: /\.html$/,
use: 'html-loader',
},
{
test: /\.json$/,
use: 'json-loader',
},
{
test: /\.(mp4|webm)$/,
use: {
Expand Down
16 changes: 5 additions & 11 deletions internals/webpack/webpack.dev.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ const plugins = [

if (DllConfig) {
glob.sync(`${DllConfig.path}/*.dll.js`).forEach((dllPath) => {
plugins.push(new AddAssetHtmlPlugin({
filepath: dllPath,
includeSourcemap: false,
plugins.push(
new AddAssetHtmlPlugin({
filepath: dllPath,
includeSourcemap: false,
}));
});
}
Expand All @@ -51,14 +52,7 @@ const dependencyHandlers = () => {

// If the package.json does not have a dllPlugin property, use the CommonsChunkPlugin
if (!DllConfig) {
return [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
children: true,
minChunks: 2,
async: true,
}),
];
return [];
}

const dllPath = path.resolve(process.cwd(), DllConfig.path || 'node_modules/auth-flow-dlls');
Expand Down
1 change: 1 addition & 0 deletions internals/webpack/webpack.dll.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DllConfig, entries } from '../dllConfig';
const outputPath = join(process.cwd(), DllConfig.path);

export default baseConfig({
mode: 'development',
context: process.cwd(),
entry: {
authFlowDeps: entries(pkg),
Expand Down
42 changes: 31 additions & 11 deletions internals/webpack/webpack.prod.babel.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import path from 'path';
import webpack from 'webpack';
import { HashedModuleIdsPlugin } from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import OfflinePlugin from 'offline-plugin';
import ManifestPlugin from 'webpack-manifest-plugin';
import WebpackPwaManifest from 'webpack-pwa-manifest';
import baseConfig from './webpack.base.babel';

const prodConfig = baseConfig({
mode: 'production',
// In production, we skip all hot-reloading stuff
entry: [
path.join(process.cwd(), 'app/app.js'),
Expand All @@ -17,16 +18,16 @@ const prodConfig = baseConfig({
chunkFilename: '[name].[chunkhash].chunk.js',
},

plugins: [
new ManifestPlugin({ fileName: 'assets.json' }),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
children: true,
minChunks: 2,
async: true,
}),
optimization: {
minimize: true,
nodeEnv: 'production',
sideEffects: true,
concatenateModules: true,
splitChunks: { chunks: 'all' },
runtimeChunk: true,
},

plugins: [
// Minify and optimize the index.html
new HtmlWebpackPlugin({
template: 'app/index.html',
Expand Down Expand Up @@ -69,6 +70,25 @@ const prodConfig = baseConfig({

AppCache: false,
}),

new WebpackPwaManifest({
name: 'Auth',
short_name: 'Auth',
background_color: '#fafafa',
theme_color: '#b1624d',
icons: [
{
src: path.resolve('app/images/icon-512x512.png'),
sizes: [72, 96, 120, 128, 144, 152, 167, 180, 192, 384, 512],
},
],
}),

new HashedModuleIdsPlugin({
hashFunction: 'sha256',
hashDigest: 'hex',
hashDigestLength: 20,
}),
],

performance: {
Expand Down
2 changes: 1 addition & 1 deletion internals/webpack/webpack.server.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const createCSSRule = (ext, ruleList) => ({
});

export default {
mode: 'production',
entry: path.resolve(process.cwd(), 'app/server/index.js'),

output: {
Expand Down Expand Up @@ -116,6 +117,5 @@ export default {
}),
new webpack.NamedModulesPlugin(),
new webpack.LoaderOptionsPlugin({ minimize: true }),
new webpack.optimize.ModuleConcatenationPlugin(),
],
};
Loading

0 comments on commit 5478ff1

Please sign in to comment.