chore(react): cleanup build and package.json
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xyflow/react",
|
||||
"version": "12.0.0",
|
||||
"version": "12.0.0-alpha.0",
|
||||
"description": "React Flow - A highly customizable React library for building node-based editors and interactive flow charts.",
|
||||
"keywords": [
|
||||
"react",
|
||||
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"source": "src/index.ts",
|
||||
"main": "dist/umd/index.js",
|
||||
"module": "dist/esm/index.mjs",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/esm/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -36,8 +36,8 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/wbkd/react-flow.git",
|
||||
"directory": "packages/core"
|
||||
"url": "https://github.com/xyflow/xyflow.git",
|
||||
"directory": "packages/react"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "concurrently \"rollup --config node:@xyflow/rollup-config --watch\" pnpm:css-watch",
|
||||
@@ -51,12 +51,10 @@
|
||||
"@types/d3": "^7.4.0",
|
||||
"@types/d3-drag": "^3.0.1",
|
||||
"@types/d3-selection": "^3.0.3",
|
||||
"@types/d3-zoom": "^3.0.1",
|
||||
"@xyflow/system": "workspace:*",
|
||||
"classcat": "^5.0.3",
|
||||
"d3-drag": "^3.0.0",
|
||||
"d3-selection": "^3.0.0",
|
||||
"d3-zoom": "^3.0.0",
|
||||
"zustand": "^4.4.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -73,7 +71,7 @@
|
||||
"autoprefixer": "^10.4.15",
|
||||
"cssnano": "^6.0.1",
|
||||
"postcss": "^8.4.21",
|
||||
"postcss-cli": "^10.1.0",
|
||||
"postcss-cli": "^11.0.0",
|
||||
"postcss-combine-duplicated-selectors": "^10.0.3",
|
||||
"postcss-import": "^15.1.0",
|
||||
"postcss-nested": "^6.0.0",
|
||||
@@ -85,11 +83,10 @@
|
||||
"globals": {
|
||||
"classcat": "cc",
|
||||
"d3-selection": "d3Selection",
|
||||
"d3-zoom": "d3Zoom",
|
||||
"d3-drag": "d3Drag",
|
||||
"zustand": "zustand",
|
||||
"zustand/shallow": "zustandShallow"
|
||||
},
|
||||
"name": "ReactFlowCore"
|
||||
"name": "ReactFlow"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,4 +95,5 @@ export {
|
||||
getStraightPath,
|
||||
getViewportForBounds,
|
||||
getNodesBounds,
|
||||
internalsSymbol,
|
||||
} from '@xyflow/system';
|
||||
|
||||
@@ -103,5 +103,6 @@ export {
|
||||
type GetStraightPathParams,
|
||||
getStraightPath,
|
||||
getViewportForBounds,
|
||||
getNodesBounds
|
||||
getNodesBounds,
|
||||
internalsSymbol
|
||||
} from '@xyflow/system';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"source": "src/index.ts",
|
||||
"main": "dist/umd/index.js",
|
||||
"module": "dist/esm/index.mjs",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/esm/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -32,7 +32,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/wbkd/react-flow.git",
|
||||
"url": "https://github.com/xyflow/xyflow.git",
|
||||
"directory": "packages/system"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
1994
pnpm-lock.yaml
generated
1994
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -25,22 +25,23 @@ const onwarn = (warning, rollupWarn) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const esmConfig = defineConfig({
|
||||
input: pkg.source,
|
||||
output: {
|
||||
file: pkg.module,
|
||||
format: 'esm',
|
||||
banner: '"use client"',
|
||||
},
|
||||
onwarn,
|
||||
plugins: [
|
||||
peerDepsExternal({
|
||||
includeDependencies: true,
|
||||
}),
|
||||
...defaultPlugins,
|
||||
typescript(),
|
||||
],
|
||||
});
|
||||
const defineEsmConfig = (format) =>
|
||||
defineConfig({
|
||||
input: pkg.source,
|
||||
output: {
|
||||
file: format === 'js' ? pkg.module : pkg.module.replace('.js', '.mjs'),
|
||||
format: 'esm',
|
||||
banner: pkg.rollup?.vanilla ? undefined : '"use client"',
|
||||
},
|
||||
onwarn,
|
||||
plugins: [
|
||||
peerDepsExternal({
|
||||
includeDependencies: true,
|
||||
}),
|
||||
...defaultPlugins,
|
||||
typescript(),
|
||||
],
|
||||
});
|
||||
|
||||
const reactGlobals = {
|
||||
react: 'React',
|
||||
@@ -53,7 +54,10 @@ const globals = {
|
||||
...(pkg.rollup?.globals || {}),
|
||||
};
|
||||
|
||||
export const umdConfig = defineConfig({
|
||||
const esmMjsConfig = defineEsmConfig('mjs');
|
||||
const esmJsConfig = defineEsmConfig('js');
|
||||
|
||||
const umdConfig = defineConfig({
|
||||
input: pkg.source,
|
||||
output: {
|
||||
file: pkg.main,
|
||||
@@ -75,4 +79,4 @@ export const umdConfig = defineConfig({
|
||||
],
|
||||
});
|
||||
|
||||
export default isProd ? [esmConfig, umdConfig] : esmConfig;
|
||||
export default isProd ? [esmMjsConfig, esmJsConfig, umdConfig] : esmMjsConfig;
|
||||
|
||||
Reference in New Issue
Block a user