added client default bundle build

This commit is contained in:
bill bittner 2018-03-29 13:39:04 -07:00
parent fe5e9cce40
commit cc027de954
10 changed files with 5869 additions and 3480 deletions

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import GoogleAnalytics from 'react-ga'; import GoogleAnalytics from 'react-ga';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
const { analytics: { googleId } } = require('../../../config/siteConfig.js'); const { analytics: { googleId } } = require('siteConfig.js');
GoogleAnalytics.initialize(googleId); GoogleAnalytics.initialize(googleId);

View file

@ -1,6 +1,6 @@
import * as actions from 'constants/publish_action_types'; import * as actions from 'constants/publish_action_types';
import { LOGIN } from 'constants/publish_channel_select_states'; import { LOGIN } from 'constants/publish_channel_select_states';
const { publishing } = require('../../config/siteConfig.js'); const { publishing } = require('siteConfig.js');
const initialState = { const initialState = {
disabled : publishing.disabled, disabled : publishing.disabled,

View file

@ -1,4 +1,4 @@
const siteConfig = require('../../config/siteConfig.js'); const siteConfig = require('siteConfig.js');
const { const {
analytics: { analytics: {

View file

@ -1,5 +1,3 @@
const logger = require('winston');
function SiteConfig () { function SiteConfig () {
this.analytics = { this.analytics = {
googleId: 'default', googleId: 'default',
@ -35,10 +33,10 @@ function SiteConfig () {
}; };
this.update = (config) => { this.update = (config) => {
if (!config) { if (!config) {
return logger.warn('No site config received.'); return console.log('No site config received.');
} }
const { analytics, assetDefaults, auth, customComponents, details, publishing } = config; const { analytics, assetDefaults, auth, customComponents, details, publishing } = config;
logger.info('Configuring site details...'); console.log('Configuring site details...');
this.analytics = analytics; this.analytics = analytics;
this.assetDefaults = assetDefaults; this.assetDefaults = assetDefaults;
this.auth = auth; this.auth = auth;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

34
webpack.client.common.js Normal file
View file

@ -0,0 +1,34 @@
const Path = require('path');
const CLIENT_ROOT = Path.resolve(__dirname, 'client/');
const CONFIG_ROOT = Path.resolve(__dirname, 'config/');
module.exports = {
target: 'web',
entry : ['babel-polyfill', 'whatwg-fetch', './client/index.js'],
output: {
path : Path.join(__dirname, 'public/bundle/'),
publicPath: 'public/bundle/',
filename : 'bundle.js',
},
module: {
loaders: [
{
test : /.jsx?$/,
loader : 'babel-loader',
exclude: /node_modules/,
query : {
presets: ['es2015', 'react', 'stage-2'],
},
},
],
},
resolve: {
modules: [
CLIENT_ROOT,
CONFIG_ROOT,
'node_modules',
__dirname,
],
extensions: ['.js', '.jsx', '.scss'],
},
};

View file

@ -1,5 +1,7 @@
const packageBaseConfig = require('./webpack.package.common.js'); const packageBaseConfig = require('./webpack.package.common.js');
const clientBaseConfig = require('./webpack.client.common.js');
module.exports = [ module.exports = [
clientBaseConfig,
packageBaseConfig, packageBaseConfig,
]; ];

View file

@ -1,4 +1,5 @@
const packageBaseConfig = require('./webpack.package.common.js'); const packageBaseConfig = require('./webpack.package.common.js');
const clientBaseConfig = require('./webpack.client.common.js');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const devBuildConfig = { const devBuildConfig = {
@ -8,4 +9,5 @@ const devBuildConfig = {
module.exports = [ module.exports = [
merge(packageBaseConfig, devBuildConfig), merge(packageBaseConfig, devBuildConfig),
merge(clientBaseConfig, devBuildConfig),
]; ];

View file

@ -2,6 +2,7 @@ const webpack = require('webpack');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const packageBaseConfig = require('./webpack.package.common.js'); const packageBaseConfig = require('./webpack.package.common.js');
const clientBaseConfig = require('./webpack.client.common.js');
const productionBuildConfig = { const productionBuildConfig = {
devtool: 'source-map', devtool: 'source-map',
@ -17,4 +18,5 @@ const productionBuildConfig = {
module.exports = [ module.exports = [
merge(packageBaseConfig, productionBuildConfig), merge(packageBaseConfig, productionBuildConfig),
merge(clientBaseConfig, productionBuildConfig),
]; ];