update: more bundle stuff
This commit is contained in:
10
package.json
10
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"
|
||||
|
||||
@@ -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
|
||||
|
||||
2
src/custom.d.ts
vendored
2
src/custom.d.ts
vendored
@@ -1,2 +1,2 @@
|
||||
declare const __REACT_FLOW_VERSION__: string;
|
||||
declare const __REVUE_FLOW_VERSION__: string;
|
||||
declare const __ENV__: string;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user