Skip to content

Commit

Permalink
project dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
user1910524aaaa committed Jul 12, 2022
1 parent ad9dab5 commit afd8a0c
Show file tree
Hide file tree
Showing 9 changed files with 3,102 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
bracketSpacing: true,
bracketSameLine: true,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
printWidth: 120,
endOfLine: 'lf',
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# react.gracestack
# react.gracestack
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>React Typescript Webpack</title>
</head>
<body>
<!-- React app root element -->
<div id="root"></div>
</body>
</html>
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "react.gracestack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"format:write": "prettier --write .",
"dev:webpack": "webpack serve",
"dev": "run-p dev:*"
},
"repository": {
"type": "git",
"url": "git+https://github.com/user1910524aaaa/react.gracestack.git"
},
"author": "Paul Filip",
"license": "ISC",
"bugs": {
"url": "https://github.com/user1910524aaaa/react.gracestack/issues"
},
"homepage": "https://github.com/user1910524aaaa/react.gracestack#readme",
"devDependencies": {
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"@webpack-cli/serve": "^1.7.0",
"css-loader": "^6.7.1",
"html-webpack-plugin": "^5.5.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"ts-loader": "^9.3.1",
"typescript": "^4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
6 changes: 6 additions & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';

export default function App() {
return <h1>Hello, world!</h1>;
}
// export default App;
6 changes: 6 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';

import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));
10 changes: 10 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"outDir": "./dist",
"target": "es5",
"module": "es6",
"jsx": "react",
"noImplicitAny": true,
"allowSyntheticDefaultImports": true
}
}
40 changes: 40 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const nodeExternals = require('webpack-node-externals');

module.exports = {
mode: 'none',
entry: path.join(__dirname, 'src', 'index.tsx'),
target: 'web',
externals: nodeExternals(),
resolve: {
modules: ['node_modules'],
extensions: ['.ts', '.tsx', '.js', 'jsx'],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css?$/,
use: 'css-loader',
exclude: /node_modules/,
},
],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, './index.html'),
}),
],
devServer: {
static: './dist',
},
};
Loading

0 comments on commit afd8a0c

Please sign in to comment.