mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor(infra): no bundle infra (#5414)
This commit is contained in:
@@ -1,39 +1,13 @@
|
||||
{
|
||||
"name": "@toeverything/infra",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"exports": {
|
||||
"./blocksuite": {
|
||||
"types": "./dist/src/blocksuite/index.d.ts",
|
||||
"import": "./dist/blocksuite.js",
|
||||
"require": "./dist/blocksuite.cjs"
|
||||
},
|
||||
"./command": {
|
||||
"types": "./dist/src/command/index.d.ts",
|
||||
"import": "./dist/command.js",
|
||||
"require": "./dist/command.cjs"
|
||||
},
|
||||
"./atom": {
|
||||
"type": "./dist/src/atom.d.ts",
|
||||
"import": "./dist/atom.js",
|
||||
"require": "./dist/atom.cjs"
|
||||
},
|
||||
"./app-config-storage": {
|
||||
"type": "./dist/src/app-config-storage.d.ts",
|
||||
"import": "./dist/app-config-storage.js",
|
||||
"require": "./dist/app-config-storage.cjs"
|
||||
},
|
||||
"./__internal__/*": {
|
||||
"type": "./dist/src/__internal__/*.d.ts",
|
||||
"import": "./dist/__internal__/*.js",
|
||||
"require": "./dist/__internal__/*.cjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"dev": "vite build --watch"
|
||||
"./blocksuite": "./src/blocksuite/index.ts",
|
||||
"./command": "./src/command/index.ts",
|
||||
"./atom": "./src/atom/index.ts",
|
||||
"./app-config-storage": "./src/app-config-storage.ts",
|
||||
"./__internal__/*": "./src/__internal__/*.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@affine/debug": "workspace:*",
|
||||
@@ -51,9 +25,7 @@
|
||||
"@affine/templates": "workspace:*",
|
||||
"@blocksuite/lit": "0.11.0-nightly-202312220916-e3abcbb",
|
||||
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"async-call-rpc": "^6.3.1",
|
||||
"electron": "link:../../frontend/electron/node_modules/electron",
|
||||
"nanoid": "^5.0.3",
|
||||
"react": "^18.2.0",
|
||||
"rxjs": "^7.8.1",
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "infra",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"sourceRoot": "packages/common/src",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["{projectRoot}/**/*"],
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"outputs": ["{projectRoot}/dist"]
|
||||
}
|
||||
},
|
||||
"tags": ["infra"]
|
||||
}
|
||||
@@ -4,7 +4,6 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"noEmit": false,
|
||||
"moduleResolution": "bundler",
|
||||
"outDir": "lib"
|
||||
},
|
||||
"references": [
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { fileURLToPath } from 'url';
|
||||
import { defineConfig } from 'vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
|
||||
const root = fileURLToPath(new URL('.', import.meta.url));
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
minify: false,
|
||||
lib: {
|
||||
entry: {
|
||||
blocksuite: resolve(root, 'src/blocksuite/index.ts'),
|
||||
atom: resolve(root, 'src/atom/index.ts'),
|
||||
command: resolve(root, 'src/command/index.ts'),
|
||||
'app-config-storage': resolve(root, 'src/app-config-storage.ts'),
|
||||
},
|
||||
formats: ['es', 'cjs'],
|
||||
name: 'AffineInfra',
|
||||
},
|
||||
rollupOptions: {
|
||||
external: [
|
||||
'electron',
|
||||
'async-call-rpc',
|
||||
'rxjs',
|
||||
'zod',
|
||||
'react',
|
||||
'yjs',
|
||||
'nanoid',
|
||||
/^jotai/,
|
||||
/^@blocksuite/,
|
||||
/^@affine\/templates/,
|
||||
],
|
||||
},
|
||||
},
|
||||
plugins: [dts()],
|
||||
});
|
||||
Reference in New Issue
Block a user