Update etc/

This commit is contained in:
0x1eef 2024-09-03 01:29:42 -03:00
parent 26cd2802f4
commit 690925421a
2 changed files with 14 additions and 5 deletions

View file

@ -1,4 +1,10 @@
{ {
"include": [
"../src/js/typings/globals.d.ts",
"../src/**/*.ts",
"../src/**/*.tsx",
],
"exclude": ["../node_modules"],
"compilerOptions": { "compilerOptions": {
"strict": true, "strict": true,
"module": "commonjs", "module": "commonjs",
@ -7,7 +13,7 @@
"esModuleInterop": true, "esModuleInterop": true,
"jsx": "react-jsx", "jsx": "react-jsx",
"lib": [ "ES2020", "DOM" ], "lib": [ "ES2020", "DOM" ],
"baseUrl": "src/", "baseUrl": "../src/",
"paths": { "~/*": ["js/*"] }, "paths": { "~/*": ["js/*"] },
"types": ["node", "jest", "@testing-library/jest-dom", "@types/chrome"] "types": ["node", "jest", "@testing-library/jest-dom", "@types/chrome"]
} }

View file

@ -1,5 +1,6 @@
const path = require("path"); const path = require("path");
const process = require("process"); const process = require("process");
const webpack = require("webpack");
const CopyPlugin = require("copy-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const { CleanWebpackPlugin } = require("clean-webpack-plugin");
@ -9,17 +10,16 @@ module.exports = {
}, },
output: { output: {
filename: "js/[name].js", filename: "js/[name].js",
path: path.resolve(__dirname, "build") path: path.resolve(__dirname, "..", "build")
}, },
resolve: { resolve: {
alias: { alias: {
"~": [path.resolve("src/js/")], "~": [path.resolve(__dirname, "..", "src", "js")],
"react": "preact/compat", "react": "preact/compat",
"react-dom": "preact/compat", "react-dom": "preact/compat",
"react/jsx-runtime": "preact/jsx-runtime", "react/jsx-runtime": "preact/jsx-runtime",
}, },
roots: [path.resolve("src/js"), path.resolve("node_modules")], modules: [path.resolve(__dirname, "..", "node_modules")],
modules: [path.resolve("src/js"), path.resolve("node_modules")],
extensions: [".ts", ".tsx"] extensions: [".ts", ".tsx"]
}, },
module: { module: {
@ -47,5 +47,8 @@ module.exports = {
], ],
}), }),
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
new webpack.ProvidePlugin({
React: ['preact/compat']
}),
], ],
} }