mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00
initial commit, project is ready to start
This commit is contained in:
parent
466dd01327
commit
74232d7671
9 changed files with 14845 additions and 0 deletions
16
.babelrc
Normal file
16
.babelrc
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
/*
|
||||
a preset is a set of plugins used to support particular language features.
|
||||
The two presets Babel uses by default: es2015, react
|
||||
*/
|
||||
"presets": [
|
||||
"@babel/preset-env", //compiling ES2015+ syntax
|
||||
"@babel/preset-react" //for react
|
||||
],
|
||||
/*
|
||||
Babel's code transformations are enabled by applying plugins (or presets) to your configuration file.
|
||||
*/
|
||||
"plugins": [
|
||||
"@babel/plugin-transform-runtime"
|
||||
]
|
||||
}
|
10
index.html
Normal file
10
index.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="./src/index.js"></script>
|
||||
</body>
|
||||
</html>
|
5
index.js
Normal file
5
index.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import React from 'react';
|
||||
import reactDom from 'react-dom';
|
||||
import App from './src/App';
|
||||
|
||||
reactDom.render(<App />, document.getElementById('root'));
|
14490
package-lock.json
generated
Normal file
14490
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
46
package.json
Normal file
46
package.json
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "rpp2210-mvp",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "webpack-dev-server .",
|
||||
"build": "Webpack .",
|
||||
"test": "test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/danny-avila/rpp2210-mvp.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/danny-avila/rpp2210-mvp/issues"
|
||||
},
|
||||
"homepage": "https://github.com/danny-avila/rpp2210-mvp#readme",
|
||||
"dependencies": {
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.20.7",
|
||||
"@babel/core": "^7.20.12",
|
||||
"@babel/eslint-parser": "^7.19.1",
|
||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"babel-loader": "^9.1.2",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"eslint": "^8.33.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"path": "^0.12.7",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1",
|
||||
"webpack-dev-server": "^4.11.1"
|
||||
}
|
||||
}
|
11
public/index.html
Normal file
11
public/index.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Webpack App</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"><script defer src="main.js"></script></head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="main.js"></script>
|
||||
</body>
|
||||
</html>
|
180
public/main.js
Normal file
180
public/main.js
Normal file
File diff suppressed because one or more lines are too long
7
src/App.js
Normal file
7
src/App.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
const App = () => {
|
||||
return <h1>Welcome to React App thats build using Webpack and Babel separately</h1>;
|
||||
};
|
||||
|
||||
export default App;
|
80
webpack.config.js
Normal file
80
webpack.config.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
/*We are basically telling webpack to take index.js from entry. Then check for all file extensions in resolve.
|
||||
After that apply all the rules in module.rules and produce the output and place it in main.js in the public folder.*/
|
||||
|
||||
module.exports = {
|
||||
/** "mode"
|
||||
* the environment - development, production, none. tells webpack
|
||||
* to use its built-in optimizations accordingly. default is production
|
||||
*/
|
||||
mode: 'development',
|
||||
/** "entry"
|
||||
* the entry point
|
||||
*/
|
||||
entry: './index.js',
|
||||
output: {
|
||||
/** "path"
|
||||
* the folder path of the output file
|
||||
*/
|
||||
path: path.resolve(__dirname, 'public'),
|
||||
/** "filename"
|
||||
* the name of the output file
|
||||
*/
|
||||
filename: 'main.js'
|
||||
},
|
||||
/** "target"
|
||||
* setting "node" as target app (server side), and setting it as "web" is
|
||||
* for browser (client side). Default is "web"
|
||||
*/
|
||||
target: 'web',
|
||||
devServer: {
|
||||
/** "port"
|
||||
* port of dev server
|
||||
*/
|
||||
port: '9500',
|
||||
/** "static"
|
||||
* This property tells Webpack what static file it should serve
|
||||
*/
|
||||
static: ['./public'],
|
||||
/** "open"
|
||||
* opens the browser after server is successfully started
|
||||
*/
|
||||
open: true,
|
||||
/** "hot"
|
||||
* enabling and disabling HMR. takes "true", "false" and "only".
|
||||
* "only" is used if enable Hot Module Replacement without page
|
||||
* refresh as a fallback in case of build failures
|
||||
*/
|
||||
hot: true,
|
||||
/** "liveReload"
|
||||
* disable live reload on the browser. "hot" must be set to false for this to work
|
||||
*/
|
||||
liveReload: true
|
||||
},
|
||||
resolve: {
|
||||
/** "extensions"
|
||||
* If multiple files share the same name but have different extensions, webpack will
|
||||
* resolve the one with the extension listed first in the array and skip the rest.
|
||||
* This is what enables users to leave off the extension when importing
|
||||
*/
|
||||
extensions: ['.js', '.jsx', '.json']
|
||||
},
|
||||
module: {
|
||||
/** "rules"
|
||||
* This says - "Hey webpack compiler, when you come across a path that resolves to a '.js or .jsx'
|
||||
* file inside of a require()/import statement, use the babel-loader to transform it before you
|
||||
* add it to the bundle. And in this process, kindly make sure to exclude node_modules folder from
|
||||
* being searched"
|
||||
*/
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/, //kind of file extension this rule should look for and apply in test
|
||||
exclude: /node_modules/, //folder to be excluded
|
||||
use: 'babel-loader' //loader which we are going to use
|
||||
}
|
||||
]
|
||||
},
|
||||
// plugins: [new HtmlWebpackPlugin()],
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue