Skip to content

Commit

Permalink
feat(bundle): allow any external dependecy in custom components
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Oct 24, 2020
1 parent 3ef7f0b commit f069b70
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/backend/bundler/config.js
Expand Up @@ -7,7 +7,6 @@ const replace = require('@rollup/plugin-replace')
const json = require('@rollup/plugin-json')
const { terser } = require('rollup-plugin-terser')

const reactIsExport = ['isValidElementType', 'isContextConsumer', 'isElement', 'ForwardRef']

const external = [
'react',
Expand Down Expand Up @@ -65,6 +64,7 @@ const plugins = ({ babelConfig = {}, commonJSConfig = {}, minify = false } = {})
const pluginStack = [
resolve({
extensions,
mainFields: ['main', 'module'],
}),
json(),
replace({
Expand All @@ -73,17 +73,12 @@ const plugins = ({ babelConfig = {}, commonJSConfig = {}, minify = false } = {})
'process.env.': 'AdminBro.env.',
}),
commonjs({
/* namedExports: {
'node_modules/flat/index.js': ['flatten', 'unflatten'],
'node_modules/react-redux/node_modules/react-is/index.js': reactIsExport,
'@material-ui/utils/node_modules/react-is': reactIsExport,
'node_modules/react-is/index.js': reactIsExport,
}, */
...commonJSConfig,
}),
babel({
extensions,
babelrc: false,
babelHelpers: 'bundled',
exclude: 'node_modules/**/*.js',
presets: [
require.resolve('@babel/preset-react'),
Expand Down

0 comments on commit f069b70

Please sign in to comment.