Skip to content

Commit

Permalink
Merge pull request #32 from ZachLamb/firebaseDeployConfig
Browse files Browse the repository at this point in the history
Fixes Webpack prod build bug + Firebase deployment config
  • Loading branch information
calebhsu authored Oct 27, 2016
2 parents 8b38375 + 8e2980c commit caa6235
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "gridproject-fd25f"
}
}
34 changes: 34 additions & 0 deletions database.rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"rules": {
".read": "auth != null && data.child('users').child(auth.uid).child('admin').val() == true",
".write": "auth != null && data.child('users').child(auth.uid).child('admin').val() == true",
"users": {
".read": "auth != null",
".write": "auth != null",
".indexOn": [
"email"
]
},
"grids": {
"$grid": {
".read": "auth != null && (data.child('users').child(auth.uid).exists() || !data.exists())",
".write": "auth != null && (data.child('users').child(auth.uid).exists() || !data.exists())",
".validate": "newData.hasChildren()",
"numCols": {
".validate": "newData.val() > 0"
},
"numRows": {
".validate": "newData.val() > 0"
},
"name": {},
"users": {},
"$row": {
".validate": "$row.matches(/^(r)[0-9]+$/) && newData.hasChildren()",
"$col": {
".validate": "$col.matches(/^(c)[0-9]+$/) && newData.val().matches(/^(rgb\\()(((0|1)?[0-9]{1,2}|2[0-4][0-9]|25[0-5]),( )?){2}((0|1)?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\\)$/)"
}
}
}
}
}
}
14 changes: 14 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
21 changes: 16 additions & 5 deletions webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,30 @@ var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
loaders.push({
test: /[\/\\]src[\/\\].*\.css/,
exclude: /(node_modules|bower_components|public)/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]')
loaders: [
'style?sourceMap',
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]'
]
});

// local scss modules
loaders.push({
test: /[\/\\]src[\/\\].*\.scss/,
exclude: /(node_modules|bower_components|public)/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass')
loaders: [
'style?sourceMap',
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]',
'sass'
]
});
// global css files

// global css
loaders.push({
test: /[\/\\](node_modules|global)[\/\\].*\.css$/,
loader: ExtractTextPlugin.extract('style', 'css')
loaders: [
'style?sourceMap',
'css'
]
});

module.exports = {
Expand Down Expand Up @@ -60,7 +71,7 @@ module.exports = {
}),
new HtmlWebpackPlugin({
template: './src/template.html',
title: 'Webpack App'
title: 'React Color'
}),
new webpack.optimize.DedupePlugin()
]
Expand Down

0 comments on commit caa6235

Please sign in to comment.