fix(build): repair nocss build
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"internal": true,
|
||||
"type": "module",
|
||||
"main": "../dist/nocss/index.js",
|
||||
"module": "../dist/nocss/index.js",
|
||||
"types": "../dist/nocss/index.d.ts"
|
||||
"main": "../dist/nocss/umd/index.js",
|
||||
"module": "../dist/nocss/esm/index.js",
|
||||
"types": "../dist/nocss/esm/index.d.ts"
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
"import": "./dist/esm/index.js",
|
||||
"require": "./dist/umd/index.js"
|
||||
},
|
||||
"./nocss": {
|
||||
"import": "./dist/nocss/esm/index.js",
|
||||
"require": "./dist/nocss/umd/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"types": "dist/esm/index.d.ts",
|
||||
|
||||
@@ -20,6 +20,18 @@ const defaultOutputOptions = {
|
||||
sourcemap: true,
|
||||
};
|
||||
|
||||
const globals = {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
classcat: 'cc',
|
||||
'd3-selection': 'd3',
|
||||
'd3-zoom': 'd3',
|
||||
'react-draggable': 'ReactDraggable',
|
||||
zustand: 'zustand',
|
||||
'zustand/shallow': 'zustandShallow',
|
||||
'zustand/context': 'zustandContext',
|
||||
};
|
||||
|
||||
export const baseConfig = ({ outputOptions = {}, injectCSS = true } = {}) => {
|
||||
const output = {
|
||||
...defaultOutputOptions,
|
||||
@@ -96,29 +108,33 @@ export const baseConfig = ({ outputOptions = {}, injectCSS = true } = {}) => {
|
||||
|
||||
export default isProd && !isTesting
|
||||
? [
|
||||
// esm build
|
||||
baseConfig(),
|
||||
// umd build
|
||||
baseConfig({
|
||||
outputOptions: {
|
||||
dir: 'dist/umd',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
name: 'ReactFlow',
|
||||
globals: {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
classcat: 'cc',
|
||||
'd3-selection': 'd3',
|
||||
'd3-zoom': 'd3',
|
||||
'react-draggable': 'ReactDraggable',
|
||||
zustand: 'zustand',
|
||||
'zustand/shallow': 'zustandShallow',
|
||||
'zustand/context': 'zustandContext',
|
||||
},
|
||||
globals,
|
||||
},
|
||||
}),
|
||||
// nocsss esm build
|
||||
baseConfig({
|
||||
outputOptions: {
|
||||
dir: 'dist/nocss',
|
||||
dir: 'dist/nocss/esm',
|
||||
},
|
||||
injectCSS: false,
|
||||
}),
|
||||
// nocsss umd build
|
||||
baseConfig({
|
||||
outputOptions: {
|
||||
dir: 'dist/nocss/umd',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
name: 'ReactFlow',
|
||||
globals,
|
||||
},
|
||||
|
||||
injectCSS: false,
|
||||
|
||||
Reference in New Issue
Block a user