1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-07 21:47:02 +09:00

Merge pull request #1043 from anyproto/bug/fix-file-icons

Chore/rspack-tools
This commit is contained in:
Razor 2024-11-12 10:57:23 +01:00 committed by GitHub
commit 47177453df
Signed by: github
GPG key ID: B5690EEEBB952194
5 changed files with 1325 additions and 358 deletions

1
.gitignore vendored
View file

@ -18,6 +18,7 @@ docs/*
electron/env.json
src/json/schema
licenses.json
dist/.rsdoctor
# generated by rspack
/compilation-stats.json

1645
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,8 @@
"lint": "eslint .",
"electron": "npx electron .",
"electron-win": "npx electron.cmd .",
"doctor:start:dev": "RSDOCTOR=true npm run start:dev",
"doctor:build:dev": "RSDOCTOR=true npm run build:dev",
"start:watch": "cross-env-shell rspack serve --mode=development --node-env=development --env SERVER_PORT=$SERVER_PORT --env DATA_PATH=$DATA_PATH",
"start:electron-wait-rspack": "cross-env-shell wait-for-localhost $SERVER_PORT && npm run electron",
"start:electron-wait-rspack-win": "cross-env-shell wait-for-localhost $SERVER_PORT && npm run electron-win",
@ -48,15 +50,15 @@
"homepage": "https://anytype.io",
"devDependencies": {
"@electron/notarize": "^2.5.0",
"@rsdoctor/rspack-plugin": "^0.4.8",
"@rspack/cli": "^1.1.0",
"@rspack/core": "^1.1.0",
"@rspack/dev-server": "^1.0.9",
"@rspack/plugin-react-refresh": "^1.0.0",
"@types/history": "^4.7.8",
"@types/jquery": "^3.5.14",
"@types/katex": "^0.14.0",
"@types/lodash": "^4.14.165",
"@types/node": "^12.19.4",
"@types/node": "^22.9.0",
"@types/prismjs": "^1.16.1",
"@types/raf": "^3.4.0",
"@types/react": "^16.14.31",
@ -70,6 +72,7 @@
"electron-builder": "^24.13.3",
"eslint": "^8.29.0",
"eslint-plugin-react": "^7.31.11",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"husky": "^8.0.3",
"license-checker": "^25.0.1",
"lint-staged": "^13.0.3",
@ -84,9 +87,7 @@
"style-loader": "^1.2.1",
"typescript": "^5.3.3",
"typescript-eslint": "^0.0.1-alpha.0",
"url-loader": "^4.1.1",
"wait-for-localhost-cli": "^3.0.0",
"webpack-dev-server": "^5.1.0"
"wait-for-localhost-cli": "^3.0.0"
},
"dependencies": {
"@electron/remote": "^2.1.2",

View file

@ -2,7 +2,8 @@ const path = require('path');
const process = require('process');
const rspack = require('@rspack/core');
const ReactRefreshPlugin = require('@rspack/plugin-react-refresh');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const { RsdoctorRspackPlugin } = require('@rsdoctor/rspack-plugin');
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json'));
const cMapsDir = path.join(pdfjsDistPath, 'cmaps');
@ -58,16 +59,18 @@ module.exports = (env, argv) => {
path.resolve('./node_modules')
]
},
watchOptions: {
ignored: /node_modules/,
poll: false,
},
devServer: {
hot: true,
static: {
directory: path.join(__dirname, 'dist'),
watch: {
ignored: [
path.resolve(__dirname, 'dist'),
path.resolve(__dirname, 'node_modules')
],
static: ['dist'],
watchFiles: {
paths: ['src'],
options: {
usePolling: false,
},
},
@ -161,7 +164,9 @@ module.exports = (env, argv) => {
plugins: [
!prod && new ReactRefreshPlugin(),
//new BundleAnalyzerPlugin(),
process.env.RSDOCTOR && new RsdoctorRspackPlugin({}),
new ForkTsCheckerWebpackPlugin(),
// new rspack.IgnorePlugin({
// resourceRegExp: /osx-temperature-sensor/,

View file

@ -13,6 +13,9 @@
"allowJs": true,
"baseUrl": "./src",
"lib": [ "es5", "dom" ],
"isolatedModules": true,
"incremental": true,
"types": ["node", "@rspack/core/module"],
"paths": {
"json": [