mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
build: improve webpack config (#3561)
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
{
|
||||
"name": "@affine/bookmark-plugin",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["{projectRoot}/**/*"],
|
||||
"outputs": [
|
||||
"{workspaceRoot}/apps/core/public/plugins/bookmark",
|
||||
"{workspaceRoot}/apps/electron/dist/plugins/bookmark"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": ["plugin"]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
{
|
||||
"name": "@affine/copilot-plugin",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"tags": ["plugin"]
|
||||
"tags": ["plugin"],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["{projectRoot}/**/*"],
|
||||
"outputs": [
|
||||
"{workspaceRoot}/apps/core/public/plugins/copilot",
|
||||
"{workspaceRoot}/apps/electron/dist/plugins/copilot"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
{
|
||||
"name": "@affine/hello-world-plugin",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"tags": ["plugin"]
|
||||
"tags": ["plugin"],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["{projectRoot}/**/*"],
|
||||
"outputs": [
|
||||
"{workspaceRoot}/apps/core/public/plugins/hello-world",
|
||||
"{workspaceRoot}/apps/electron/dist/plugins/hello-world"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { PluginContext } from '@affine/sdk/entry';
|
||||
import { currentWorkspaceAtom, rootStore } from '@affine/sdk/entry';
|
||||
import { createElement } from 'react';
|
||||
import { lazy } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
@@ -11,7 +10,6 @@ const HeaderItem = lazy(() =>
|
||||
export const entry = (context: PluginContext) => {
|
||||
console.log('register');
|
||||
console.log('hello, world!');
|
||||
console.log(rootStore.get(currentWorkspaceAtom));
|
||||
context.register('headerItem', div => {
|
||||
const root = createRoot(div);
|
||||
root.render(createElement(HeaderItem));
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
{
|
||||
"name": "@affine/image-preview-plugin",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"tags": ["plugin"]
|
||||
"tags": ["plugin"],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["{projectRoot}/**/*"],
|
||||
"outputs": [
|
||||
"{workspaceRoot}/apps/core/public/plugins/image-preview",
|
||||
"{workspaceRoot}/apps/electron/dist/plugins/image-preview"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user