This repository has been archived by the owner on Nov 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab53887
commit c390919
Showing
61 changed files
with
37,894 additions
and
50,080 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.idea/* | ||
node_modules/* | ||
dist/* | ||
functions/node_modules/* | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,15 @@ git clone https://[email protected]/LaurenceHo/reactjs-beautiful-weather. | |
``` | ||
or | ||
``` | ||
git clone https://github.com/bluegray1015/reactjs-beautiful-weather.git | ||
git clone https://github.com/LaurenceHo/reactjs-beautiful-weather.git | ||
``` | ||
|
||
* Install npm package: | ||
``` | ||
npm install | ||
npm i | ||
``` | ||
|
||
* Put your google & darksky API key into `./functions/apiKey.js` | ||
* Put your google & dark sky API key into `./functions/apiKey.js` | ||
|
||
* Launch the app: | ||
``` | ||
|
@@ -45,8 +45,12 @@ Please visit: https://cloud.google.com/functions/ for more detail | |
1. Run `npm run firebase-init` | ||
2. Visit https://console.firebase.google.com to create a new project | ||
3. Add the firebase project into your local configuration `npm run firebase-add` | ||
4. If you want to deploy the whole project, run `npm run firebase-deploy` | ||
5. If you just want to deploy the cloud functions, run `npm run deploy-functions` | ||
4. You may need to change the default project setting in the `.firebaserc` | ||
5. If you want to deploy the whole project, run `npm run firebase-deploy` | ||
6. If you want to deploy the cloud functions only, run `npm run deploy-functions` | ||
|
||
### Live demo | ||
https://react-beautiful-weather-app.firebaseapp.com/ | ||
|
||
## License | ||
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
const merge = require('webpack-merge'); | ||
const DefinePlugin = require('webpack/lib/DefinePlugin'); | ||
const common = require('./webpack.common.js'); | ||
const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin'); | ||
|
||
module.exports = merge(common, { | ||
mode: 'development', | ||
devtool: 'inline-source-map', | ||
devServer: { | ||
contentBase: '../dist', | ||
historyApiFallback: true, | ||
hot: true, | ||
inline: true | ||
}, | ||
plugins: [ | ||
new HotModuleReplacementPlugin() | ||
] | ||
}); | ||
mode: 'development', | ||
devtool: 'inline-source-map', | ||
devServer: { | ||
contentBase: '../dist', | ||
historyApiFallback: true, | ||
hot: true, | ||
inline: true | ||
}, | ||
plugins: [ | ||
new HotModuleReplacementPlugin(), | ||
new DefinePlugin({ | ||
'process.env': { | ||
'NODE_ENV': JSON.stringify('development') | ||
} | ||
}) | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,46 @@ | ||
const CompressionPlugin = require('compression-webpack-plugin'); | ||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||
const merge = require('webpack-merge'); | ||
const DefinePlugin = require('webpack/lib/DefinePlugin'); | ||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||
const common = require('./webpack.common.js'); | ||
|
||
module.exports = merge(common, { | ||
mode: 'production', | ||
devtool: 'source-map', | ||
plugins: [ | ||
new DefinePlugin({ | ||
'process.env': { | ||
'NODE_ENV': JSON.stringify('production') | ||
} | ||
}) | ||
], | ||
optimization: { | ||
splitChunks: { | ||
cacheGroups: { | ||
commons: { | ||
test: /[\\/]node_modules[\\/]/, | ||
name: "vendors", | ||
chunks: "all" | ||
} | ||
} | ||
}, | ||
minimize: true, | ||
minimizer: [ | ||
new UglifyJsPlugin({ | ||
uglifyOptions: { | ||
compress: { | ||
warnings: false | ||
}, | ||
sourceMap: true | ||
} | ||
}) | ||
] | ||
} | ||
}); | ||
mode: 'production', | ||
devtool: 'source-map', | ||
plugins: [ | ||
new DefinePlugin({ | ||
'process.env': { | ||
'NODE_ENV': JSON.stringify('production') | ||
} | ||
}), | ||
new CompressionPlugin({ | ||
filename: "[path].gz[query]", | ||
algorithm: "gzip", | ||
test: /\.js$|\.css$|\.html$/, | ||
threshold: 10240, | ||
minRatio: 0 | ||
}) | ||
], | ||
optimization: { | ||
splitChunks: { | ||
cacheGroups: { | ||
commons: { | ||
test: /[\\/]node_modules[\\/]/, | ||
name: 'vendors', | ||
chunks: 'all' | ||
} | ||
} | ||
}, | ||
minimize: true, | ||
minimizer: [ | ||
new UglifyJsPlugin({ | ||
uglifyOptions: { | ||
compress: { | ||
warnings: false | ||
}, | ||
sourceMap: true | ||
} | ||
}) | ||
] | ||
} | ||
}); |
Oops, something went wrong.