mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
dcefce874f
This commit adds full Typescript support. Although .js files will keep on working normally, it's encouraged that new files are created with either .tsx(for components) or .ts(for non components) extensions. Also, a linter with some basic settings for React and Typescript has been added. These settings can be changed at any time if needed.
34 lines
678 B
TypeScript
34 lines
678 B
TypeScript
import path from "path";
|
|
import { Configuration } from "webpack";
|
|
|
|
const config: Configuration = {
|
|
entry: "./src/index.js",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(ts|js)x?$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "babel-loader",
|
|
options: {
|
|
presets: [
|
|
"@babel/preset-env",
|
|
"@babel/preset-react",
|
|
"@babel/preset-typescript",
|
|
],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: [".tsx", ".ts", ".jsx", ".js"],
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, "static/frontend"),
|
|
filename: "main.js",
|
|
},
|
|
};
|
|
|
|
export default config;
|