Skip to content

Commit

Permalink
chore: change build config
Browse files Browse the repository at this point in the history
  • Loading branch information
1ncounter committed Apr 9, 2024
1 parent cbf57e3 commit 6b8d0c1
Show file tree
Hide file tree
Showing 42 changed files with 229 additions and 333 deletions.
8 changes: 4 additions & 4 deletions packages/designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "2.0.0-beta.0",
"description": "Designer for Ali LowCode Engine",
"type": "module",
"main": "dist/designer.cjs",
"module": "dist/designer.js",
"main": "dist/low-code-designer.cjs",
"module": "dist/low-code-designer.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/designer.js",
"require": "./dist/designer.cjs",
"import": "./dist/low-code-designer.js",
"require": "./dist/low-code-designer.cjs",
"types": "./dist/index.d.ts"
}
},
Expand Down
29 changes: 6 additions & 23 deletions packages/designer/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
import { defineConfig, type LibraryFormats } from 'vite';
import { resolve } from 'node:path';
import { env } from 'node:process';
import react from '@vitejs/plugin-react';
import { devDependencies, peerDependencies } from './package.json';
import { defineConfig } from 'vite';
import baseConfigFn from '../../vite.base.config'

const externals = [...Object.keys(peerDependencies), ...Object.keys(devDependencies)];
const formats = (env['FORMATS']?.split(',') ?? ['es', 'cjs']) as LibraryFormats[];

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(import.meta.dirname, 'src/index.ts'),
name: 'LowCodeDesigner',
formats,
// the proper extensions will be added
fileName: 'designer',
},
rollupOptions: {
external: externals,
},
},
plugins: [react()],
export default defineConfig(async () => {
return baseConfigFn({
name: 'LowCodeDesigner',
})
});
6 changes: 3 additions & 3 deletions packages/editor-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"description": "Core Api for Ali lowCode engine",
"license": "MIT",
"type": "module",
"main": "dist/editorCore.js",
"module": "dist/editorCore.js",
"main": "dist/low-code-editor-core.js",
"module": "dist/low-code-editor-core.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/editorCore.js",
"import": "./dist/low-code-editor-core.js",
"types": "./dist/index.d.ts"
}
},
Expand Down
29 changes: 6 additions & 23 deletions packages/editor-core/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
import { defineConfig, type LibraryFormats } from 'vite';
import { resolve } from 'node:path';
import { env } from 'node:process';
import react from '@vitejs/plugin-react';
import { devDependencies, peerDependencies } from './package.json';
import { defineConfig } from 'vite';
import baseConfigFn from '../../vite.base.config'

const externals = [...Object.keys(peerDependencies), ...Object.keys(devDependencies)];
const formats = (env['FORMATS']?.split(',') ?? ['es', 'cjs']) as LibraryFormats[];

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(import.meta.dirname, 'src/index.ts'),
name: 'LowCodeEditorCore',
formats,
// the proper extensions will be added
fileName: 'editorCore',
},
rollupOptions: {
external: externals,
},
},
plugins: [react()],
export default defineConfig(async () => {
return baseConfigFn({
name: 'LowCodeEditorCore',
})
});
8 changes: 4 additions & 4 deletions packages/editor-skeleton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "2.0.0-beta.0",
"description": "alibaba lowcode editor skeleton",
"type": "module",
"main": "dist/editorSkeleton.cjs",
"module": "dist/editorSkeleton.js",
"main": "dist/low-code-editor-skeleton.cjs",
"module": "dist/low-code-editor-skeleton.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/editorSkeleton.js",
"require": "./dist/editorSkeleton.cjs",
"import": "./dist/low-code-editor-skeleton.js",
"require": "./dist/low-code-editor-skeleton.cjs",
"types": "./dist/index.d.ts"
}
},
Expand Down
30 changes: 7 additions & 23 deletions packages/editor-skeleton/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
import { defineConfig, type LibraryFormats } from 'vite';
import { resolve } from 'node:path';
import { env } from 'node:process'
import react from '@vitejs/plugin-react';
import { devDependencies, peerDependencies } from './package.json';
import { defineConfig } from 'vite';
import baseConfigFn from '../../vite.base.config'

const externals = [...Object.keys(peerDependencies), ...Object.keys(devDependencies)];
const formats = (env['FORMATS']?.split(',') ?? ['es', 'cjs']) as LibraryFormats[];

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(import.meta.dirname, 'src/index.ts'),
name: 'LowCodeEditorSkeleton',
formats,
// the proper extensions will be added
fileName: 'editorSkeleton',
},
rollupOptions: {
external: externals,
},
},
plugins: [react()],
export default defineConfig(async () => {
return baseConfigFn({
name: 'LowCodeEditorSkeleton',
defaultFormats: ['es', 'cjs']
})
});
8 changes: 4 additions & 4 deletions packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "2.0.0-beta.0",
"description": "An enterprise-class low-code technology stack with scale-out design / 一套面向扩展设计的企业级低代码技术体系",
"type": "module",
"main": "dist/engine.js",
"module": "dist/engine.js",
"main": "dist/ali-low-code-engine.js",
"module": "dist/ali-low-code-engine.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/engine.js",
"require": "./dist/engine.cjs",
"import": "./dist/ali-low-code-engine.js",
"require": "./dist/ali-low-code-engine.cjs",
"types": "./dist/index.d.ts"
}
},
Expand Down
48 changes: 20 additions & 28 deletions packages/engine/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
import { defineConfig, LibraryFormats } from 'vite';
import { resolve } from 'node:path';
import { env } from 'node:process';
import react from '@vitejs/plugin-react';
import { devDependencies, peerDependencies } from './package.json';
import { defineConfig, mergeConfig } from 'vite';
import baseConfigFn from '../../vite.base.config'

const externals = [...Object.keys(peerDependencies), ...Object.keys(devDependencies)];
const formats = (env['FORMATS']?.split(',') ?? ['es', 'cjs']) as LibraryFormats[];
export default defineConfig(async () => {
const baseConfig = await baseConfigFn({
name: 'AliLowCodeEngine',
defaultFormats: ['es', 'cjs'],
})

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(import.meta.dirname, 'src/index.ts'),
name: 'AliLowCodeEngine',
formats,
// the proper extensions will be added
fileName: 'engine',
},
rollupOptions: {
external: externals,
output: {
// for UMD
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'@alifd/next': 'Next'
return mergeConfig(baseConfig, defineConfig({
build: {
rollupOptions: {
output: {
// for UMD
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'@alifd/next': 'Next'
},
},
},
},
},
plugins: [react()],
}
}))
});

16 changes: 11 additions & 5 deletions packages/plugin-command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"homepage": "https://github.com/alibaba/lowcode-engine#readme",
"license": "ISC",
"type": "module",
"main": "dist/command.cjs",
"module": "dist/command.js",
"main": "dist/low-code-plugin-command.cjs",
"module": "dist/low-code-plugin-command.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/command.js",
"require": "./dist/command.cjs",
"import": "./dist/low-code-plugin-command.js",
"require": "./dist/low-code-plugin-command.cjs",
"types": "./dist/index.d.ts"
}
},
Expand All @@ -34,7 +34,13 @@
},
"dependencies": {
"@alilc/lowcode-types": "workspace:*",
"@alilc/lowcode-utils": "workspace:*"
"@alilc/lowcode-utils": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
23 changes: 7 additions & 16 deletions packages/plugin-command/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import { defineConfig, LibraryFormats } from 'vite';
import { resolve } from 'node:path';
import { env } from 'node:process';
import { defineConfig } from 'vite';
import baseConfigFn from '../../vite.base.config'

const formats = (env['FORMATS']?.split(',') ?? ['es', 'cjs']) as LibraryFormats[];

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(import.meta.dirname, 'src/index.ts'),
name: 'LowCodePluginCommand',
formats,
// the proper extensions will be added
fileName: 'plugin-command',
},
},
export default defineConfig(async () => {
return baseConfigFn({
name: 'LowCodePluginCommand',
defaultFormats: ['es', 'cjs']
})
});
8 changes: 4 additions & 4 deletions packages/plugin-designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "2.0.0-beta.0",
"description": "alibaba lowcode editor designer plugin",
"type": "module",
"main": "dist/designer.cjs",
"module": "dist/designer.js",
"main": "dist/low-code-plugin-designer.cjs",
"module": "dist/low-code-plugin-designer.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/designer.js",
"require": "./dist/designer.cjs",
"import": "./dist/low-code-plugin-designer.js",
"require": "./dist/low-code-plugin-designer.cjs",
"types": "./dist/index.d.ts"
}
},
Expand Down
31 changes: 8 additions & 23 deletions packages/plugin-designer/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
import { defineConfig, LibraryFormats } from 'vite';
import { env } from 'node:process';
import { resolve } from 'node:path';
import react from '@vitejs/plugin-react';
import { devDependencies, peerDependencies } from './package.json';
import { defineConfig } from 'vite';
import baseConfigFn from '../../vite.base.config'

const externals = [...Object.keys(peerDependencies), ...Object.keys(devDependencies)];
const formats = (env['FORMATS']?.split(',') ?? ['es', 'cjs']) as LibraryFormats[];

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(import.meta.dirname, 'src/index.tsx'),
name: 'LowCodePluginDesigner',
formats,
// the proper extensions will be added
fileName: 'plugin-designer',
},
rollupOptions: {
external: externals,
},
},
plugins: [react()],
export default defineConfig(async () => {
return baseConfigFn({
name: 'LowCodePluginDesigner',
defaultFormats: ['es', 'cjs'],
entry: 'src/index.tsx'
})
});
8 changes: 4 additions & 4 deletions packages/plugin-outline-pane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "1.3.2",
"description": "Outline pane for Ali lowCode engine",
"type": "module",
"main": "dist/plugin-outline-pane.cjs",
"module": "dist/plugin-outline-pane.js",
"main": "dist/low-code-plugin-outline-pane.cjs",
"module": "dist/low-code-plugin-outline-pane.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/plugin-outline-pane.js",
"require": "./dist/plugin-outline-pane.cjs",
"import": "./dist/low-code-plugin-outline-pane.js",
"require": "./dist/low-code-plugin-outline-pane.cjs",
"types": "./dist/index.d.ts"
}
},
Expand Down
31 changes: 8 additions & 23 deletions packages/plugin-outline-pane/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
import { defineConfig, LibraryFormats } from 'vite';
import { env } from 'node:process';
import { resolve } from 'node:path';
import react from '@vitejs/plugin-react';
import { devDependencies, peerDependencies } from './package.json';
import { defineConfig } from 'vite';
import baseConfigFn from '../../vite.base.config'

const externals = [...Object.keys(peerDependencies), ...Object.keys(devDependencies)];
const formats = (env['FORMATS']?.split(',') ?? ['es', 'cjs']) as LibraryFormats[];

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(import.meta.dirname, 'src/index.tsx'),
name: 'LowCodePluginOutlinePane',
formats,
// the proper extensions will be added
fileName: 'plugin-outline-pane',
},
rollupOptions: {
external: externals,
},
},
plugins: [react()],
export default defineConfig(async () => {
return baseConfigFn({
name: 'LowCodePluginOutlinePane',
defaultFormats: ['es', 'cjs'],
entry: 'src/index.tsx'
})
});
Loading

0 comments on commit 6b8d0c1

Please sign in to comment.