Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: optimize frontend build configs to improve superset-ui-plugin dev experience #9326

Merged
merged 4 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions superset-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,36 @@
* specific language governing permissions and limitations
* under the License.
*/
const packageConfig = require('./package.json');

module.exports = {
sourceMaps: true,
sourceType: 'unambiguous',
sourceType: 'module',
ktmud marked this conversation as resolved.
Show resolved Hide resolved
retainLines: true,
presets: [
'@babel/preset-react',
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
loose: true,
shippedProposals: true,
modules: false,
targets: false,
shippedProposals: true,
targets: packageConfig.browserslist,
},
],
[
'@babel/preset-react',
{ development: process.env.BABEL_ENV === 'development' },
],
ktmud marked this conversation as resolved.
Show resolved Hide resolved
],
plugins: [
'lodash',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-class-properties',
'react-hot-loader/babel',
'@babel/plugin-proposal-optional-chaining',
ktmud marked this conversation as resolved.
Show resolved Hide resolved
['@babel/plugin-transform-runtime', { corejs: 3 }],
'react-hot-loader/babel',
],
env: {
// Setup a different config for tests as they run in node instead of a browser
Expand All @@ -52,8 +58,8 @@ module.exports = {
corejs: 3,
loose: true,
shippedProposals: true,
targets: { node: 'current' },
modules: 'commonjs',
targets: { node: 'current' },
},
],
],
Expand Down
4 changes: 4 additions & 0 deletions superset-frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ module.exports = {
diagnostics: {
warnOnly: true,
},
tsConfig: {
jsx: 'react',
esModuleInterop: true,
},
ktmud marked this conversation as resolved.
Show resolved Hide resolved
},
},
};
Loading