From 4d2dfa14df99d1fdc5c41fc6e6d6e27d63c9983e Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Sat, 10 Jul 2021 15:28:24 +0200 Subject: [PATCH] update: more bundle stuff --- package.json | 10 +++------- rollup.config.js | 6 +++--- src/custom.d.ts | 2 +- src/store/index.ts | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 28b01d2c..eaac719a 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,8 @@ }, "license": "MIT", "author": "Burak Cakmakoglu", - "main": "dist/revue-flow.cjs.js", - "browser": "dist/revue-flow.esm.js", - "unpkg": "dist/revue-flow.global.js", - "jsdelivr": "dist/revue-flow.global.js", - "module": "dist/revue-flow.esm-bundler.js", - "types": "dist/index.d.ts", + "main": "dist/revue-flow.es.js", + "module": "dist/revue-flow.umd.js", "files": [ "dist", "nocss" @@ -24,7 +20,7 @@ "build:dist": "rollup -c --environment NODE_ENV:production", "build:app": "vite build -c vite.config.app.ts", "serve": "vite preview", - "prepublishOnly": "yarn build:dist", + "prepublishOnly": "yarn build", "test": "exit 0;", "lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .", "lint": "yarn lint:js" diff --git a/rollup.config.js b/rollup.config.js index 8e578a1e..72ded5dd 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -82,7 +82,7 @@ function createConfig(format, output, plugins = []) { output.sourcemap = !!process.env.SOURCE_MAP; output.banner = banner; output.externalLiveBindings = false; - output.globals = { vue: 'Vue', 'vue-demi': 'VueDemi' }; + output.globals = { 'vue-demi': 'VueDemi' }; const isProductionBuild = /\.prod\.js$/.test(output.file); const isGlobalBuild = format.startsWith('global'); @@ -111,7 +111,7 @@ function createConfig(format, output, plugins = []) { // during a single build. hasTSChecked = true; - const external = ['vue', 'vue-demi', (id) => id.includes('@babel/runtime')]; + const external = ['vue-demi', (id) => id.includes('@babel/runtime')]; const nodePlugins = [resolve(), commonjs({ include: 'node_modules/**' })]; @@ -170,7 +170,7 @@ function createReplacePlugin(isProduction, isBundlerESMBuild, isBrowserBuild, is // is targeting Node (SSR)? __NODE_JS__: isNodeBuild, __ENV__: JSON.stringify(process.env.NODE_ENV), - __REACT_FLOW_VERSION__: JSON.stringify(pkg.version), + __REVUE_FLOW_VERSION__: JSON.stringify(pkg.version), preventAssignment: true }; // allow inline overrides like diff --git a/src/custom.d.ts b/src/custom.d.ts index 68bb83c7..fe131545 100644 --- a/src/custom.d.ts +++ b/src/custom.d.ts @@ -1,2 +1,2 @@ -declare const __REACT_FLOW_VERSION__: string; +declare const __REVUE_FLOW_VERSION__: string; declare const __ENV__: string; diff --git a/src/store/index.ts b/src/store/index.ts index 766f835e..d429944f 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -53,7 +53,7 @@ export const initialState: ReactFlowState = { multiSelectionActive: false, - reactFlowVersion: typeof __REACT_FLOW_VERSION__ !== 'undefined' ? __REACT_FLOW_VERSION__ : '-' + reactFlowVersion: typeof __REVUE_FLOW_VERSION__ !== 'undefined' ? __REVUE_FLOW_VERSION__ : '-' }; const store = configureStore(initialState);