@easy-editor/materials-dashboard-bar-chart 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rollup.config.js DELETED
@@ -1,212 +0,0 @@
1
- import babel from '@rollup/plugin-babel'
2
- import commonjs from '@rollup/plugin-commonjs'
3
- import nodeResolve from '@rollup/plugin-node-resolve'
4
- import json from '@rollup/plugin-json'
5
- import { terser } from 'rollup-plugin-terser'
6
- import cleanup from 'rollup-plugin-cleanup'
7
- import postcss from 'rollup-plugin-postcss'
8
- import pkg from './package.json' with { type: 'json' }
9
-
10
- const GLOBAL_NAME = 'EasyEditorMaterialsBarChart'
11
-
12
- // 外部依赖(不打包进组件)
13
- const external = ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core']
14
-
15
- const globals = {
16
- react: 'React',
17
- 'react-dom': 'ReactDOM',
18
- 'react/jsx-runtime': 'jsxRuntime',
19
- '@easy-editor/core': 'EasyEditorCore',
20
- }
21
-
22
- const plugins = [
23
- nodeResolve({
24
- extensions: ['.js', '.ts', '.jsx', '.tsx'],
25
- }),
26
- commonjs(),
27
- json(),
28
- postcss({
29
- modules: {
30
- generateScopedName: '[name]__[local]___[hash:base64:5]',
31
- },
32
- autoModules: true,
33
- minimize: true,
34
- inject: true,
35
- }),
36
- babel({
37
- extensions: ['.js', '.ts', '.jsx', '.tsx'],
38
- exclude: 'node_modules/**',
39
- babelrc: false,
40
- babelHelpers: 'bundled',
41
- presets: [
42
- ['@babel/preset-react', { runtime: 'automatic' }],
43
- [
44
- '@babel/preset-typescript',
45
- {
46
- allowDeclareFields: true,
47
- },
48
- ],
49
- ],
50
- }),
51
- cleanup({
52
- comments: ['some', /PURE/],
53
- extensions: ['.js', '.ts'],
54
- }),
55
- ]
56
-
57
- export default [
58
- /* ---------------------------------- 元数据构建 --------------------------------- */
59
- {
60
- input: 'src/meta.ts',
61
- output: [
62
- {
63
- file: 'dist/meta.esm.js',
64
- format: 'esm',
65
- sourcemap: true,
66
- banner: `/* @easy-editor/materials-dashboard-bar-chart v${pkg.version} (meta, esm) */`,
67
- exports: 'named',
68
- },
69
- ],
70
- plugins,
71
- external,
72
- },
73
- {
74
- input: 'src/meta.ts',
75
- output: [
76
- {
77
- file: 'dist/meta.js',
78
- format: 'umd',
79
- name: `${GLOBAL_NAME}Meta`,
80
- globals,
81
- sourcemap: true,
82
- banner: `/* @easy-editor/materials-dashboard-bar-chart v${pkg.version} (meta) */`,
83
- exports: 'named',
84
- },
85
- ],
86
- plugins,
87
- external,
88
- },
89
- {
90
- input: 'src/meta.ts',
91
- output: [
92
- {
93
- file: 'dist/meta.min.js',
94
- format: 'umd',
95
- name: `${GLOBAL_NAME}Meta`,
96
- globals,
97
- sourcemap: true,
98
- banner: `/* @easy-editor/materials-dashboard-bar-chart v${pkg.version} (meta, minified) */`,
99
- exports: 'named',
100
- },
101
- ],
102
- plugins: [...plugins, terser()],
103
- external,
104
- },
105
-
106
- /* ---------------------------------- 组件构建 ---------------------------------- */
107
- {
108
- input: 'src/component.tsx',
109
- output: [
110
- {
111
- file: 'dist/component.esm.js',
112
- format: 'esm',
113
- sourcemap: true,
114
- banner: `/* @easy-editor/materials-dashboard-bar-chart v${pkg.version} (component, esm) */`,
115
- exports: 'named',
116
- },
117
- ],
118
- plugins,
119
- external,
120
- },
121
- {
122
- input: 'src/component.tsx',
123
- output: [
124
- {
125
- file: 'dist/component.js',
126
- format: 'umd',
127
- name: `${GLOBAL_NAME}Component`,
128
- globals,
129
- sourcemap: true,
130
- banner: `/* @easy-editor/materials-dashboard-bar-chart v${pkg.version} (component) */`,
131
- exports: 'named',
132
- },
133
- ],
134
- plugins,
135
- external,
136
- },
137
- {
138
- input: 'src/component.tsx',
139
- output: [
140
- {
141
- file: 'dist/component.min.js',
142
- format: 'umd',
143
- name: `${GLOBAL_NAME}Component`,
144
- globals,
145
- sourcemap: true,
146
- banner: `/* @easy-editor/materials-dashboard-bar-chart v${pkg.version} (component, minified) */`,
147
- exports: 'named',
148
- },
149
- ],
150
- plugins: [...plugins, terser()],
151
- external,
152
- },
153
-
154
- /* ---------------------------------- 完整构建 ---------------------------------- */
155
- {
156
- input: 'src/index.tsx',
157
- output: [
158
- {
159
- file: 'dist/index.js',
160
- format: 'umd',
161
- name: GLOBAL_NAME,
162
- globals,
163
- sourcemap: true,
164
- banner: `/* @easy-editor/materials-dashboard-bar-chart v${pkg.version} */`,
165
- exports: 'named',
166
- },
167
- ],
168
- plugins,
169
- external,
170
- },
171
- {
172
- input: 'src/index.tsx',
173
- output: [
174
- {
175
- file: 'dist/index.esm.js',
176
- format: 'esm',
177
- sourcemap: true,
178
- },
179
- ],
180
- plugins,
181
- external,
182
- },
183
- {
184
- input: 'src/index.tsx',
185
- output: [
186
- {
187
- file: 'dist/index.cjs',
188
- format: 'cjs',
189
- sourcemap: true,
190
- exports: 'named',
191
- },
192
- ],
193
- plugins,
194
- external,
195
- },
196
- {
197
- input: 'src/index.tsx',
198
- output: [
199
- {
200
- file: 'dist/index.min.js',
201
- format: 'umd',
202
- name: GLOBAL_NAME,
203
- globals,
204
- sourcemap: true,
205
- banner: `/* @easy-editor/materials-dashboard-bar-chart v${pkg.version} (minified) */`,
206
- exports: 'named',
207
- },
208
- ],
209
- plugins: [...plugins, terser()],
210
- external,
211
- },
212
- ]
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.json",
3
- "compilerOptions": {
4
- "jsx": "react-jsx",
5
- "strictPropertyInitialization": false,
6
- "outDir": "./dist",
7
- "skipLibCheck": true,
8
- "esModuleInterop": true,
9
- "allowSyntheticDefaultImports": true
10
- },
11
- "include": ["./src"]
12
- }
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.build.json",
3
- "compilerOptions": {
4
- "noEmit": true
5
- },
6
- "include": ["./src"]
7
- }
package/vite.config.ts DELETED
@@ -1,54 +0,0 @@
1
- /**
2
- * Vite Configuration for Material Development
3
- * 物料开发 Vite 配置
4
- */
5
-
6
- import { defineConfig } from 'vite'
7
- import react from '@vitejs/plugin-react'
8
- import { materialDevPlugin } from './.vite/plugins/vite-plugin-material-dev'
9
- import { externalDeps } from './.vite/plugins/vite-plugin-external-deps'
10
-
11
- export default defineConfig({
12
- plugins: [
13
- react(),
14
- // 外部化 React/ReactDOM,使用父应用提供的实例
15
- externalDeps({
16
- externals: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
17
- globals: {
18
- react: 'React',
19
- 'react-dom': 'ReactDOM',
20
- 'react/jsx-runtime': 'jsxRuntime',
21
- '@easy-editor/core': 'EasyEditorCore',
22
- },
23
- }),
24
- materialDevPlugin({
25
- entry: '/src/index.tsx',
26
- }),
27
- ],
28
- server: {
29
- port: 5001,
30
- host: 'localhost',
31
- cors: true,
32
- hmr: {
33
- port: 5001,
34
- },
35
- },
36
- build: {
37
- target: 'esnext',
38
- rollupOptions: {
39
- // 确保生产构建也外部化这些依赖
40
- external: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
41
- output: {
42
- globals: {
43
- react: 'React',
44
- 'react-dom': 'ReactDOM',
45
- 'react/jsx-runtime': 'jsxRuntime',
46
- '@easy-editor/core': 'EasyEditorCore',
47
- },
48
- },
49
- },
50
- },
51
- resolve: {
52
- dedupe: ['react', 'react-dom'],
53
- },
54
- })