refactor(rollup): remove unused code
This commit is contained in:
Vendored
+28023
-45
File diff suppressed because it is too large
Load Diff
Vendored
+10178
-9562
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
+21
@@ -8353,6 +8353,27 @@
|
|||||||
"style-inject": "^0.3.0"
|
"style-inject": "^0.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rollup-plugin-replace": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-/5bxtUPkDHyBJAKketb4NfaeZjL5yLZdeUihSfbF2PQMz+rSTEb8ARKoOl3UBT4m7/X+QOXJo3sLTcq+yMMYTA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"magic-string": "^0.25.2",
|
||||||
|
"rollup-pluginutils": "^2.6.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"magic-string": {
|
||||||
|
"version": "0.25.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.4.tgz",
|
||||||
|
"integrity": "sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"sourcemap-codec": "^1.4.4"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"rollup-plugin-serve": {
|
"rollup-plugin-serve": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/rollup-plugin-serve/-/rollup-plugin-serve-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/rollup-plugin-serve/-/rollup-plugin-serve-1.0.1.tgz",
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
"rollup-plugin-livereload": "^1.0.4",
|
"rollup-plugin-livereload": "^1.0.4",
|
||||||
"rollup-plugin-node-resolve": "^5.2.0",
|
"rollup-plugin-node-resolve": "^5.2.0",
|
||||||
"rollup-plugin-postcss": "^2.0.3",
|
"rollup-plugin-postcss": "^2.0.3",
|
||||||
|
"rollup-plugin-replace": "^2.2.0",
|
||||||
"rollup-plugin-serve": "^1.0.1",
|
"rollup-plugin-serve": "^1.0.1",
|
||||||
"rollup-plugin-svg": "^2.0.0",
|
"rollup-plugin-svg": "^2.0.0",
|
||||||
"rollup-plugin-terser": "^5.1.2",
|
"rollup-plugin-terser": "^5.1.2",
|
||||||
|
|||||||
+13
-27
@@ -5,11 +5,14 @@ import postcss from 'rollup-plugin-postcss';
|
|||||||
import bundleSize from 'rollup-plugin-bundle-size';
|
import bundleSize from 'rollup-plugin-bundle-size';
|
||||||
import visualizer from 'rollup-plugin-visualizer';
|
import visualizer from 'rollup-plugin-visualizer';
|
||||||
import svg from 'rollup-plugin-svg';
|
import svg from 'rollup-plugin-svg';
|
||||||
|
import replace from 'rollup-plugin-replace';
|
||||||
|
|
||||||
import pkg from './package.json';
|
import pkg from './package.json';
|
||||||
|
|
||||||
const isProd = process.env.NODE_ENV === 'production';
|
const isProd = process.env.NODE_ENV === 'production';
|
||||||
const external = ['react', 'react-dom', 'prop-types'];
|
const input = 'src/index.js';
|
||||||
|
const processEnv = isProd ? 'production' : 'development';
|
||||||
|
const external = ['react'];
|
||||||
const onwarn = (warning, rollupWarn) => {
|
const onwarn = (warning, rollupWarn) => {
|
||||||
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
|
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
|
||||||
rollupWarn(warning);
|
rollupWarn(warning);
|
||||||
@@ -23,14 +26,17 @@ const plugins = [
|
|||||||
exclude: 'node_modules/**'
|
exclude: 'node_modules/**'
|
||||||
}),
|
}),
|
||||||
commonjs({
|
commonjs({
|
||||||
include: /node_modules/
|
include: 'node_modules/**'
|
||||||
}),
|
}),
|
||||||
svg(),
|
svg(),
|
||||||
visualizer()
|
visualizer(),
|
||||||
|
replace({
|
||||||
|
'process.env.NODE_ENV': JSON.stringify(processEnv)
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
export default [{
|
export default [{
|
||||||
input: 'src/index.js',
|
input,
|
||||||
external,
|
external,
|
||||||
onwarn,
|
onwarn,
|
||||||
output: {
|
output: {
|
||||||
@@ -39,14 +45,12 @@ export default [{
|
|||||||
format: 'umd',
|
format: 'umd',
|
||||||
sourcemap: isProd,
|
sourcemap: isProd,
|
||||||
globals: {
|
globals: {
|
||||||
react: 'React',
|
react: 'React'
|
||||||
'react-dom': 'ReactDOM',
|
|
||||||
'prop-types': 'PropTypes'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins
|
plugins
|
||||||
}, {
|
}, {
|
||||||
input: 'src/index.js',
|
input,
|
||||||
external,
|
external,
|
||||||
onwarn,
|
onwarn,
|
||||||
output: {
|
output: {
|
||||||
@@ -61,26 +65,8 @@ export default [{
|
|||||||
exclude: 'node_modules/**'
|
exclude: 'node_modules/**'
|
||||||
}),
|
}),
|
||||||
commonjs({
|
commonjs({
|
||||||
include: /node_modules/
|
include: 'node_modules/**'
|
||||||
}),
|
}),
|
||||||
svg()
|
svg()
|
||||||
]
|
]
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// }, {
|
|
||||||
// input: 'src/plugins/index.js',
|
|
||||||
// external: external,
|
|
||||||
// onwarn,
|
|
||||||
// output: {
|
|
||||||
// name: 'ReactFlow Plugins',
|
|
||||||
// file: 'dist/plugins/index.js',
|
|
||||||
// format: 'umd',
|
|
||||||
// sourcemap: isProd,
|
|
||||||
// globals: {
|
|
||||||
// react: 'React',
|
|
||||||
// 'react-dom': 'ReactDOM',
|
|
||||||
// 'prop-types': 'PropTypes'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// plugins
|
|
||||||
// }];
|
|
||||||
|
|||||||
Reference in New Issue
Block a user