Skip to content

Commit

Permalink
Update: Set import alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Oct 31, 2023
1 parent aa47077 commit c614da8
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 32 deletions.
3 changes: 2 additions & 1 deletion Todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- [www.gunma-u.ac.jp](https://www.gunma-u.ac.jp/)
- [ ] 基本的な実装

### 開発
### その他

- [ ] [webpack-chrome-extension-reloader](https://www.npmjs.com/package/webpack-chrome-extension-reloader)でホットリロードに対応する
- [x] SCSSで直にスタイルを書き込んだ場合に無効化できない問題を修正する
Expand All @@ -41,3 +41,4 @@
- [ ] ドキュメントを書く
- [x] 設定を開いている間はポップアップを無効化する
- [ ] ポップアップでの設定変更後に手動でリロードする必要がある問題を修正する
- [ ] 設定の初期値を変更する
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"tailwindcss": "^3.3.5",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.2.2",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
Expand Down
30 changes: 30 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/options/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "/styles/popup.css";
import "/styles/tailwind.css";
import "/styles/gaming.scss";
import "@/styles/popup.css";
import "@/styles/tailwind.css";
import "@/styles/gaming.scss";

import { createRoot } from "react-dom/client";
import { HashRouter } from "react-router-dom";
Expand Down
6 changes: 3 additions & 3 deletions src/popup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "/styles/popup.css";
import "/styles/tailwind.css";
import "/styles/gaming.scss";
import "@/styles/popup.css";
import "@/styles/tailwind.css";
import "@/styles/gaming.scss";

import { createRoot } from "react-dom/client";

Expand Down
6 changes: 3 additions & 3 deletions src/scripts/background.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import StorageTool from "../class/StorageTool";
import isTrue from "../utils/isTrue";
import OpenOptions from "../utils/openOptions";
import StorageTool from "@/class/StorageTool";
import isTrue from "@/utils/isTrue";
import OpenOptions from "@/utils/openOptions";

chrome.runtime.onInstalled.addListener(async () => {
const storage = new StorageTool("other");
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/content_common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "/styles/gaming.scss";
import "/styles/darkmode.scss";
import "@/styles/gaming.scss";
import "@/styles/darkmode.scss";

chrome.runtime.onMessage.addListener((message) => {
if (message === "reload") {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/content_kyomu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "/styles/kyomu.css";
import "@/styles/kyomu.css";

import { Kyomu } from "../class";
import LoadGamingWebsite from "../utils/loadGamingWebsite";
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/content_media.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "/styles/media.css";
import "@/styles/media.css";

import { Media } from "../class";
import loadGamingWebsite from "../utils/loadGamingWebsite";
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/content_moodle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "/styles/moodle.scss";
import "@/styles/moodle.scss";

import { Moodle } from "../class";
import loadGamingWebsite from "../utils/loadGamingWebsite";
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/content_mylib.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "/styles/mylibrary.css";
import "@/styles/mylibrary.css";

import { MyLibrary } from "../class";
import LoadGamingWebsite from "../utils/loadGamingWebsite";
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/content_sso.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "/styles/sso.css";
import "@/styles/sso.scss";

import { SSO } from "../class";
import loadGamingWebsite from "../utils/loadGamingWebsite";
Expand Down
14 changes: 0 additions & 14 deletions src/styles/sso.css

This file was deleted.

16 changes: 16 additions & 0 deletions src/styles/sso.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[data-gaming_gundai="true"] {
.header_column,
.input_column,
.input_form th,
#username_id_input,
#password_input {
background: transparent !important;
}

#username_id_input,
#password_input {
border: 1px solid #ccc !important;
border-radius: 5px !important;
padding: 5px !important;
}
}
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"outDir": "dist",
"strict": true,
"jsx": "react-jsx",
"esModuleInterop": true
"esModuleInterop": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
5 changes: 5 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const ESLintPlugin = require("eslint-webpack-plugin");
const fs = require("fs");
const HtmlPlugin = require("html-webpack-plugin");
const path = require("path");
const { TsconfigPathsPlugin } = require("tsconfig-paths-webpack-plugin");

const loadFilesInScripts = function () {
const dir = path.join(__dirname, "src/scripts");
Expand Down Expand Up @@ -31,6 +32,10 @@ module.exports = {
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx"],
roots: [path.resolve(__dirname, "node_modules"), path.resolve(__dirname, "src")],
plugins: [new TsconfigPathsPlugin({ configFile: path.resolve(__dirname, "tsconfig.json") })],
alias: {
"@": path.resolve(__dirname, "src"),
},
},

module: {
Expand Down

0 comments on commit c614da8

Please sign in to comment.