mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-25 01:04:14 -05:00
chore: switch to react
This commit is contained in:
@@ -29,15 +29,23 @@ const browserList = [
|
||||
];
|
||||
|
||||
const GLOBALS = {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
};
|
||||
|
||||
const EXTERNALS = [
|
||||
'react',
|
||||
'react-dom',
|
||||
'react-leonardo-ui',
|
||||
];
|
||||
|
||||
const config = (isEsm) => {
|
||||
const outputFile = isEsm ? pkg.module : pkg.main;
|
||||
const basename = path.basename(outputFile);
|
||||
const dir = path.dirname(outputFile);
|
||||
const umdName = basename.replace(/-([a-z])/g, (m, p1) => p1.toUpperCase()).split('.js').join('');
|
||||
|
||||
const external = isEsm ? Object.keys(pkg.dependencies || {}) : [];
|
||||
const external = [...EXTERNALS, ...(isEsm ? Object.keys(pkg.dependencies || {}) : [])];
|
||||
const globals = {};
|
||||
external.forEach((e) => {
|
||||
if ([GLOBALS[e]]) {
|
||||
@@ -76,7 +84,7 @@ const config = (isEsm) => {
|
||||
}],
|
||||
],
|
||||
plugins: [
|
||||
['@babel/plugin-transform-react-jsx', { pragma: 'preact.h' }],
|
||||
['@babel/plugin-transform-react-jsx'],
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user