update: more bundle stuff
This commit is contained in:
+3
-7
@@ -8,12 +8,8 @@
|
|||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Burak Cakmakoglu",
|
"author": "Burak Cakmakoglu",
|
||||||
"main": "dist/revue-flow.cjs.js",
|
"main": "dist/revue-flow.es.js",
|
||||||
"browser": "dist/revue-flow.esm.js",
|
"module": "dist/revue-flow.umd.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",
|
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
"nocss"
|
"nocss"
|
||||||
@@ -24,7 +20,7 @@
|
|||||||
"build:dist": "rollup -c --environment NODE_ENV:production",
|
"build:dist": "rollup -c --environment NODE_ENV:production",
|
||||||
"build:app": "vite build -c vite.config.app.ts",
|
"build:app": "vite build -c vite.config.app.ts",
|
||||||
"serve": "vite preview",
|
"serve": "vite preview",
|
||||||
"prepublishOnly": "yarn build:dist",
|
"prepublishOnly": "yarn build",
|
||||||
"test": "exit 0;",
|
"test": "exit 0;",
|
||||||
"lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .",
|
"lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .",
|
||||||
"lint": "yarn lint:js"
|
"lint": "yarn lint:js"
|
||||||
|
|||||||
+3
-3
@@ -82,7 +82,7 @@ function createConfig(format, output, plugins = []) {
|
|||||||
output.sourcemap = !!process.env.SOURCE_MAP;
|
output.sourcemap = !!process.env.SOURCE_MAP;
|
||||||
output.banner = banner;
|
output.banner = banner;
|
||||||
output.externalLiveBindings = false;
|
output.externalLiveBindings = false;
|
||||||
output.globals = { vue: 'Vue', 'vue-demi': 'VueDemi' };
|
output.globals = { 'vue-demi': 'VueDemi' };
|
||||||
|
|
||||||
const isProductionBuild = /\.prod\.js$/.test(output.file);
|
const isProductionBuild = /\.prod\.js$/.test(output.file);
|
||||||
const isGlobalBuild = format.startsWith('global');
|
const isGlobalBuild = format.startsWith('global');
|
||||||
@@ -111,7 +111,7 @@ function createConfig(format, output, plugins = []) {
|
|||||||
// during a single build.
|
// during a single build.
|
||||||
hasTSChecked = true;
|
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/**' })];
|
const nodePlugins = [resolve(), commonjs({ include: 'node_modules/**' })];
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ function createReplacePlugin(isProduction, isBundlerESMBuild, isBrowserBuild, is
|
|||||||
// is targeting Node (SSR)?
|
// is targeting Node (SSR)?
|
||||||
__NODE_JS__: isNodeBuild,
|
__NODE_JS__: isNodeBuild,
|
||||||
__ENV__: JSON.stringify(process.env.NODE_ENV),
|
__ENV__: JSON.stringify(process.env.NODE_ENV),
|
||||||
__REACT_FLOW_VERSION__: JSON.stringify(pkg.version),
|
__REVUE_FLOW_VERSION__: JSON.stringify(pkg.version),
|
||||||
preventAssignment: true
|
preventAssignment: true
|
||||||
};
|
};
|
||||||
// allow inline overrides like
|
// allow inline overrides like
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
declare const __REACT_FLOW_VERSION__: string;
|
declare const __REVUE_FLOW_VERSION__: string;
|
||||||
declare const __ENV__: string;
|
declare const __ENV__: string;
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ export const initialState: ReactFlowState = {
|
|||||||
|
|
||||||
multiSelectionActive: false,
|
multiSelectionActive: false,
|
||||||
|
|
||||||
reactFlowVersion: typeof __REACT_FLOW_VERSION__ !== 'undefined' ? __REACT_FLOW_VERSION__ : '-'
|
reactFlowVersion: typeof __REVUE_FLOW_VERSION__ !== 'undefined' ? __REVUE_FLOW_VERSION__ : '-'
|
||||||
};
|
};
|
||||||
|
|
||||||
const store = configureStore(initialState);
|
const store = configureStore(initialState);
|
||||||
|
|||||||
Reference in New Issue
Block a user