Skip to content

Commit

Permalink
chore: use tubeu configs
Browse files Browse the repository at this point in the history
  • Loading branch information
wholesome-ghoul committed Aug 14, 2022
1 parent 42cc51a commit d59183f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 84 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
src/
node_modules/
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@
"dotenv": "^16.0.1",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.5.0",
"html-webpack-plugin": "^5.5.0",
"husky": "^8.0.0",
"lint-staged": "^13.0.3",
"mini-css-extract-plugin": "^2.6.1",
"prettier": "^2.7.1",
"sass-loader": "^13.0.2",
"standard-version": "^9.5.0",
Expand All @@ -68,7 +66,9 @@
"typescript-plugin-css-modules": "^3.4.0",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.10.0"
"webpack-dev-server": "^4.10.0",
"@tubeu/configs-webpack": "^0.1.13",
"@tubeu/configs-tsconfig": "^0.0.6"
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
Expand Down
28 changes: 0 additions & 28 deletions tsconfig.js

This file was deleted.

8 changes: 8 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./node_modules/@tubeu/configs-tsconfig/dist/tsconfig.build.json",
"compilerOptions": {
"plugins": [{ "name": "typescript-plugin-css-modules" }],
"noEmit": true
},
"include": ["src"]
}
54 changes: 2 additions & 52 deletions webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,5 @@
import "dotenv/config"
import * as path from "path"
import * as webpack from "webpack"
import HtmlWebpackPlugin from "html-webpack-plugin"
import MiniCssExtractPlugin from "mini-css-extract-plugin"
import "webpack-dev-server"
import { generateWebpackConfig } from "@tubeu/configs-webpack"

const mode = process.env.NODE_ENV! as "development" | "production"
const port = process.env.PORT || 3000

const config: webpack.Configuration = {
mode,
entry: "./src/index.tsx",
output: {
path: path.resolve(__dirname, process.env.outDir!),
filename: "bundle.js",
},
module: {
rules: [
{
test: /\.(ts|tsx|js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
{
test: /\.s[ac]ss$/i,
use: ["style-loader", "css-loader", "sass-loader"],
},
],
},
devServer: {
static: {
directory: path.join(__dirname, process.env.outDir!),
},
open: true,
port,
},
resolve: {
extensions: [".tsx", ".jsx", ".ts", ".js"],
},
plugins: [
new HtmlWebpackPlugin({
template: "./public/index.html",
publicUrl: process.env.PUBLIC_URL!,
}),
new MiniCssExtractPlugin(),
new webpack.ProvidePlugin({
process: "process/browser",
}),
],
}
const config = { ...generateWebpackConfig({}) }

export default config
27 changes: 27 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2498,6 +2498,33 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e"
integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==

"@tubeu/configs-tsconfig@^0.0.6":
version "0.0.6"
resolved "https://registry.yarnpkg.com/@tubeu/configs-tsconfig/-/configs-tsconfig-0.0.6.tgz#78ce9228ba12df97377c9a15988cfb8d2a9b74b4"
integrity sha512-4GoKuiOYSwkiGNDRbr0RSioKuWVe63zFchkv8Ugfjy8fWy3WU7u8kLF+fhB+iswnQeNsOrovsa/JJAshzhBMMg==
dependencies:
typescript "^4.7.4"

"@tubeu/configs-webpack@^0.1.13":
version "0.1.13"
resolved "https://registry.yarnpkg.com/@tubeu/configs-webpack/-/configs-webpack-0.1.13.tgz#03fb26405b0860fa3b8b0fdbbdfd832dc2440f45"
integrity sha512-V7v1JdQqR1BxfNJd1xXNvt7ktyTNc2MuH0hAbyjcWGMZcnvsAMtsq1AK7kYHTp/NgkmIL+RE5TLTxXTZIoD9NA==
dependencies:
"@types/webpack" "^5.28.0"
babel-loader "^8.2.5"
css-loader "^6.7.1"
dotenv "^16.0.1"
html-webpack-plugin "^5.5.0"
mini-css-extract-plugin "^2.6.1"
sass-loader "^13.0.2"
style-loader "^3.3.1"
ts-loader "^9.3.1"
ts-node "^10.9.1"
typescript "^4.7.4"
webpack "^5.74.0"
webpack-cli "^4.10.0"
webpack-dev-server "^4.10.0"

"@types/aria-query@^4.2.0":
version "4.2.2"
resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc"
Expand Down

0 comments on commit d59183f

Please sign in to comment.