mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-11-18 12:40:13 +08:00
Merge branch 'master' of git.woa.com:vft-magic/tmagic-editor
This commit is contained in:
commit
511acfdb5b
@ -18,7 +18,7 @@
|
|||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build:type && vite build",
|
"build": "rimraf ./dist && npm run build:type && vite build --mode=es && vite build --mode=umd",
|
||||||
"build:type": "npm run clear:type && tsc --declaration --emitDeclarationOnly --project tsconfig.build.json",
|
"build:type": "npm run clear:type && tsc --declaration --emitDeclarationOnly --project tsconfig.build.json",
|
||||||
"clear:type": "rimraf ./types"
|
"clear:type": "rimraf ./types"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -300,7 +300,7 @@ export const compiledCond = (op: string, fieldValue: any, value: any, range: num
|
|||||||
case '<':
|
case '<':
|
||||||
return fieldValue < value;
|
return fieldValue < value;
|
||||||
case '<=':
|
case '<=':
|
||||||
return fieldValue >= value;
|
return fieldValue <= value;
|
||||||
case 'between':
|
case 'between':
|
||||||
return range.length > 1 && fieldValue >= range[0] && fieldValue <= range[1];
|
return range.length > 1 && fieldValue >= range[0] && fieldValue <= range[1];
|
||||||
case 'not_between':
|
case 'not_between':
|
||||||
|
|||||||
@ -16,30 +16,35 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig, type LibraryFormats } from 'vite';
|
||||||
|
|
||||||
import pkg from './package.json';
|
import pkg from './package.json';
|
||||||
|
|
||||||
const deps = Object.keys(pkg.dependencies);
|
const deps = Object.keys(pkg.dependencies);
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig(({ mode }) => ({
|
||||||
build: {
|
build: {
|
||||||
cssCodeSplit: false,
|
cssCodeSplit: false,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
minify: false,
|
minify: false,
|
||||||
target: 'esnext',
|
target: 'esnext',
|
||||||
|
emptyOutDir: false,
|
||||||
|
|
||||||
lib: {
|
lib: {
|
||||||
entry: 'src/index.ts',
|
entry: 'src/index.ts',
|
||||||
name: 'TMagicUtils',
|
name: 'TMagicUtils',
|
||||||
|
formats: ['es', 'umd', 'cjs'].includes(mode) ? [mode as LibraryFormats] : ['es', 'umd'],
|
||||||
fileName: 'tmagic-utils',
|
fileName: 'tmagic-utils',
|
||||||
},
|
},
|
||||||
|
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
// 确保外部化处理那些你不想打包进库的依赖
|
// 确保外部化处理那些你不想打包进库的依赖
|
||||||
external(id: string) {
|
external(id: string) {
|
||||||
|
if (mode === 'umd' && id === 'lodash-es') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return deps.some((k) => new RegExp(`^${k}`).test(id));
|
return deps.some((k) => new RegExp(`^${k}`).test(id));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
}));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user