mirror of
https://github.com/jaywcjlove/wxmp.git
synced 2026-01-12 08:18:49 +08:00
feat: add electron app.
This commit is contained in:
1
electron/preload/.gitignore
vendored
Normal file
1
electron/preload/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
lib
|
||||
16
electron/preload/package.json
Normal file
16
electron/preload/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "@wcj/wxmp-preload",
|
||||
"version": "2.1.0",
|
||||
"main": "./lib/index.js",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tsbb build --disable-babel --file-names src/index.ts",
|
||||
"watch": "tsbb watch --disable-babel --file-names src/index.ts"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"devDependencies": {
|
||||
"electron": "19.0.5"
|
||||
}
|
||||
}
|
||||
24
electron/preload/src/index.ts
Normal file
24
electron/preload/src/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
const styleStr = `.siderbar {
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
.siderbar header h1 a, github-corners {
|
||||
display: none;
|
||||
}
|
||||
article.content:before {
|
||||
-webkit-app-region: drag;
|
||||
position: absolute;
|
||||
content: ' ';
|
||||
display: block;
|
||||
height: 41px;
|
||||
width: 100%;
|
||||
z-index: -1;
|
||||
}`;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const head = document.querySelector('head');
|
||||
const style = document.createElement('style');
|
||||
style.textContent = styleStr;
|
||||
if (head) {
|
||||
head.append(style);
|
||||
}
|
||||
});
|
||||
27
electron/preload/tsconfig.json
Normal file
27
electron/preload/tsconfig.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"declaration": true,
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": false,
|
||||
"noImplicitAny": true,
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "node",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"outDir": "lib",
|
||||
"baseUrl": "."
|
||||
// "esModuleInterop": true,
|
||||
// "allowSyntheticDefaultImports": true,
|
||||
// "forceConsistentCasingInFileNames": true,
|
||||
// "noFallthroughCasesInSwitch": true,
|
||||
// "isolatedModules": false,
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user