This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: add webpack config, add alias paths, add public api for utils
- Loading branch information
Showing
48 changed files
with
12,355 additions
and
32,286 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,7 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript", | ||
["@babel/preset-react", { "runtime": "automatic" }] | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="%PUBLIC_URL%/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet"><title>Teameights</title><script defer="defer" src="main.09351a1cbb54191372fa.js"></script><link href="css/main.f3cf07e2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> |
Large diffs are not rendered by default.
Oops, something went wrong.
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,266 @@ | ||
/*! | ||
* Check to see if the MemoizeMap has recorded a result of the two operands | ||
* | ||
* @param {Mixed} leftHandOperand | ||
* @param {Mixed} rightHandOperand | ||
* @param {MemoizeMap} memoizeMap | ||
* @returns {Boolean|null} result | ||
*/ | ||
|
||
/*! | ||
* Compare two Regular Expressions for equality. | ||
* | ||
* @param {RegExp} leftHandOperand | ||
* @param {RegExp} rightHandOperand | ||
* @return {Boolean} result | ||
*/ | ||
|
||
/*! | ||
* Compare two Sets/Maps for equality. Faster than other equality functions. | ||
* | ||
* @param {Set} leftHandOperand | ||
* @param {Set} rightHandOperand | ||
* @param {Object} [options] (Optional) | ||
* @return {Boolean} result | ||
*/ | ||
|
||
/*! | ||
* Determine if the given object has an @@iterator function. | ||
* | ||
* @param {Object} target | ||
* @return {Boolean} `true` if the object has an @@iterator function. | ||
*/ | ||
|
||
/*! | ||
* Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of | ||
* each key. If any value of the given key is not equal, the function will return false (early). | ||
* | ||
* @param {Mixed} leftHandOperand | ||
* @param {Mixed} rightHandOperand | ||
* @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against | ||
* @param {Object} [options] (Optional) | ||
* @return {Boolean} result | ||
*/ | ||
|
||
/*! | ||
* Gets all entries from a Generator. This will consume the generator - which could have side effects. | ||
* | ||
* @param {Generator} target | ||
* @returns {Array} an array of entries from the Generator. | ||
*/ | ||
|
||
/*! | ||
* Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array. | ||
* This will consume the iterator - which could have side effects depending on the @@iterator implementation. | ||
* | ||
* @param {Object} target | ||
* @returns {Array} an array of entries from the @@iterator function | ||
*/ | ||
|
||
/*! | ||
* Gets all own and inherited enumerable keys from a target. | ||
* | ||
* @param {Object} target | ||
* @returns {Array} an array of own and inherited enumerable keys from the target. | ||
*/ | ||
|
||
/*! | ||
* Primary Export | ||
*/ | ||
|
||
/*! | ||
* Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual` | ||
* for each enumerable key in the object. | ||
* | ||
* @param {Mixed} leftHandOperand | ||
* @param {Mixed} rightHandOperand | ||
* @param {Object} [options] (Optional) | ||
* @return {Boolean} result | ||
*/ | ||
|
||
/*! | ||
* Returns true if the argument is a primitive. | ||
* | ||
* This intentionally returns true for all objects that can be compared by reference, | ||
* including functions and symbols. | ||
* | ||
* @param {Mixed} value | ||
* @return {Boolean} result | ||
*/ | ||
|
||
/*! | ||
* Set the result of the equality into the MemoizeMap | ||
* | ||
* @param {Mixed} leftHandOperand | ||
* @param {Mixed} rightHandOperand | ||
* @param {MemoizeMap} memoizeMap | ||
* @param {Boolean} result | ||
*/ | ||
|
||
/*! | ||
* Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers. | ||
* | ||
* @param {Iterable} leftHandOperand | ||
* @param {Iterable} rightHandOperand | ||
* @param {Object} [options] (Optional) | ||
* @return {Boolean} result | ||
*/ | ||
|
||
/*! | ||
* Simple equality for generator objects such as those returned by generator functions. | ||
* | ||
* @param {Iterable} leftHandOperand | ||
* @param {Iterable} rightHandOperand | ||
* @param {Object} [options] (Optional) | ||
* @return {Boolean} result | ||
*/ | ||
|
||
/*! | ||
* The main logic of the `deepEqual` function. | ||
* | ||
* @param {Mixed} leftHandOperand | ||
* @param {Mixed} rightHandOperand | ||
* @param {Object} [options] (optional) Additional options | ||
* @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. | ||
* @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of | ||
complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular | ||
references to blow the stack. | ||
* @return {Boolean} equal match | ||
*/ | ||
|
||
/*! | ||
* deep-eql | ||
* Copyright(c) 2013 Jake Luer <[email protected]> | ||
* MIT Licensed | ||
*/ | ||
|
||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ | ||
|
||
/** | ||
* @license | ||
* Lodash <https://lodash.com/> | ||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* react-dom.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* react-is.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* react-jsx-runtime.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* react.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* scheduler.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* use-sync-external-store-shim.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* use-sync-external-store-shim/with-selector.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @mui/styled-engine v5.13.2 | ||
* | ||
* @license MIT | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @remix-run/router v1.7.1 | ||
* | ||
* Copyright (c) Remix Software Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE.md file in the root directory of this source tree. | ||
* | ||
* @license MIT | ||
*/ | ||
|
||
/** | ||
* React Router DOM v6.14.1 | ||
* | ||
* Copyright (c) Remix Software Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE.md file in the root directory of this source tree. | ||
* | ||
* @license MIT | ||
*/ | ||
|
||
/** | ||
* React Router v6.14.1 | ||
* | ||
* Copyright (c) Remix Software Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE.md file in the root directory of this source tree. | ||
* | ||
* @license MIT | ||
*/ | ||
|
||
/** @license React v16.13.1 | ||
* react-is.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ |
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,11 @@ | ||
import { Configuration as DevServerConfiguration } from 'webpack-dev-server' | ||
import { BuildOptions } from './types/config' | ||
|
||
export function buildDevServer(options: BuildOptions): DevServerConfiguration { | ||
return { | ||
port: options.port, | ||
open: true, | ||
historyApiFallback: true, | ||
hot: true, | ||
} | ||
} |
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,40 @@ | ||
import webpack from "webpack"; | ||
import { buildCssLoader } from "./loaders/buildCssLoader"; | ||
import { BuildOptions } from "./types/config"; | ||
|
||
export function buildLoaders(optionsBuild: BuildOptions): webpack.RuleSetRule[] { | ||
const babelLoader = { | ||
test: /\.(js|ts|jsx|tsx)$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
presets: ["@babel/preset-env"], | ||
}, | ||
}, | ||
}; | ||
|
||
const svgLoader = { | ||
test: /\.svg$/, | ||
use: ["@svgr/webpack"], | ||
}; | ||
|
||
const fileLoader = { | ||
test: /\.(png|jpe?g|gif|woff2|woff)$/i, | ||
use: [ | ||
{ | ||
loader: "file-loader", | ||
}, | ||
], | ||
}; | ||
|
||
const typescriptLoader = { | ||
test: /\.tsx?$/, | ||
use: "ts-loader", | ||
exclude: /node_modules/, | ||
}; | ||
|
||
const cssLoaders = buildCssLoader(optionsBuild.isDev); | ||
|
||
return [fileLoader, svgLoader, babelLoader, typescriptLoader, cssLoaders]; | ||
} |
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,39 @@ | ||
import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin" | ||
import Dotenv from 'dotenv-webpack' | ||
import HTMLWebpackPlugin from "html-webpack-plugin" | ||
import MiniCssExtractPlugin from "mini-css-extract-plugin" | ||
import webpack from "webpack" | ||
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer" | ||
import { BuildOptions } from "./types/config" | ||
|
||
export function buildPlugins({ | ||
paths, | ||
isDev, | ||
}: BuildOptions): webpack.WebpackPluginInstance[] { | ||
const plugins = [ | ||
new Dotenv(), | ||
new HTMLWebpackPlugin({ | ||
template: paths.html, | ||
}), | ||
new webpack.ProgressPlugin(), | ||
new MiniCssExtractPlugin({ | ||
chunkFilename: "[name].css", | ||
filename: "css/[name].[contenthash:8].css", | ||
}), | ||
new webpack.DefinePlugin({ | ||
__IS_DEV__: JSON.stringify(isDev), | ||
}), | ||
]; | ||
|
||
if (isDev) { | ||
plugins.push(new webpack.HotModuleReplacementPlugin()); | ||
plugins.push( | ||
new BundleAnalyzerPlugin({ | ||
openAnalyzer: false, | ||
}) | ||
); | ||
plugins.push(new ReactRefreshWebpackPlugin()); | ||
} | ||
|
||
return plugins; | ||
} |
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,12 @@ | ||
import { ResolveOptions } from 'webpack' | ||
import { BuildOptions } from './types/config' | ||
|
||
export function buildResolvers(options: BuildOptions): ResolveOptions { | ||
return { | ||
extensions: ['.tsx', '.ts', '.js', '.jsx'], | ||
preferAbsolute: true, | ||
modules: [options.paths.src, 'node_modules'], | ||
mainFiles: ['index'], | ||
alias: {}, | ||
} | ||
} |
Oops, something went wrong.