Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceHo committed Jan 26, 2021
1 parent a6da9dd commit d68fadb
Show file tree
Hide file tree
Showing 26 changed files with 34,876 additions and 38,060 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# A beautiful weather web application using React, Redux, Typescript, Webpack4, Bootstrap4 and D3v5.
# A beautiful weather web application using React, Redux, Typescript, Webpack4, Ant Design and D3v5.

## Introduction
This project demonstrates how to use React, Redux, Typescript, Webpack4, Bootstrap4 and D3v5. It is also including two kinds of D3 force simulation demonstrations as well as gauge, which is based on my personal interest and previous project.
This project demonstrates how to use React, Redux, Typescript, Webpack4, Ant Design and D3v5. It is also including two kinds of D3 force simulation demonstrations as well as gauge, which is based on my personal interest and previous project.

## Prerequisites
The latest version of Nodejs and npm need to be installed.
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-slate
40 changes: 16 additions & 24 deletions config/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
/**
* Created by laurence-ho on 02/09/17.
*/
const path = require ('path');
const HtmlWebpackPlugin = require ('html-webpack-plugin');
const ProvidePlugin = require ('webpack/lib/ProvidePlugin');
const CleanWebpackPlugin = require ('clean-webpack-plugin');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
entry: './src/index.tsx',
output: {
path: path.resolve (__dirname, '../dist'),
path: path.resolve(__dirname, '../dist'),
filename: '[name].bundle.js'
},
resolve: {
modules: [
path.join (__dirname, "../dist"),
path.join(__dirname, "../dist"),
"node_modules"
],
extensions: [ ".ts", ".tsx", '.js', '.json' ]
extensions: [".ts", ".tsx", '.js', '.json']
},
module: {
rules: [
Expand All @@ -35,11 +34,11 @@ module.exports = {
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
use: ['style-loader', 'css-loader']
},
{
test: /\.(jpe?g|png|gif|ico)$/i,
use: [ 'file-loader' ]
use: ['file-loader']
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
Expand All @@ -52,7 +51,7 @@ module.exports = {
]
},
plugins: [
new CleanWebpackPlugin ([ '../dist' ]),
new CleanWebpackPlugin(['../dist']),
/*
* Plugin: HtmlWebpackPlugin
* Description: Simplifies creation of HTML files to serve your webpack bundles.
Expand All @@ -61,28 +60,21 @@ module.exports = {
*
* See: https://github.com/ampedandwired/html-webpack-plugin
*/
new HtmlWebpackPlugin ({
new HtmlWebpackPlugin({
template: 'src/index.html'
}),
// install jQuery and popper as the plugin for bootstrap4
new ProvidePlugin ({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
Popper: [ 'popper.js', 'default' ]
}),
/*
* Plugin: CopyWebpackPlugin
* Description: Copy files and directories in webpack.
*
* Copies project static assets.
*
* See: https://www.npmjs.com/package/copy-webpack-plugin
*/
new CopyWebpackPlugin([{
from: 'src/assets',
to: 'assets'
}])
new CopyWebpackPlugin([
{
from: 'src/assets',
to: 'assets'
}
])
]
};

10 changes: 5 additions & 5 deletions config/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const merge = require ('webpack-merge');
const common = require ('./webpack.common.js');
const HotModuleReplacementPlugin = require ('webpack/lib/HotModuleReplacementPlugin');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin');

module.exports = merge (common, {
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
Expand All @@ -12,6 +12,6 @@ module.exports = merge (common, {
inline: true
},
plugins: [
new HotModuleReplacementPlugin ()
new HotModuleReplacementPlugin()
]
});
14 changes: 7 additions & 7 deletions config/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const merge = require ('webpack-merge');
const DefinePlugin = require ('webpack/lib/DefinePlugin');
const UglifyJsPlugin = require ('uglifyjs-webpack-plugin');
const common = require ('./webpack.common.js');
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, {
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
plugins: [
new DefinePlugin ({
new DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify ('production')
'NODE_ENV': JSON.stringify('production')
}
})
],
Expand Down
Loading

0 comments on commit d68fadb

Please sign in to comment.