Commit c2ed3eee authored by Matija Obreza's avatar Matija Obreza
Browse files

Babel react-loadable: use custom import name property

parent 85bc6230
......@@ -14,6 +14,11 @@
"plugins": [
"transform-object-rest-spread",
"babel-plugin-syntax-dynamic-import",
"./react-loadable-custom/babel.js"
[
"./react-loadable-custom/babel.js",
{
"importName": "utilities/CustomReactLoadable"
}
]
]
}
......@@ -3,7 +3,7 @@
// Copy of node_modules/react-loadable/lib/babel.js, MIT licensed.
// COPYRIGHT (c) 2017-present James Kyle <me@thejameskyle.com>
//
// Added our source 'utilities/LoadableUtil'
// Added our configurable source name
exports.__esModule = true;
......@@ -16,8 +16,12 @@ exports.default = function (_ref) {
ImportDeclaration: function ImportDeclaration(path) {
var source = path.node.source.value;
// added our source
if (source !== 'utilities/LoadableUtil') return;
const opts = Object.assign({
importName: 'react-loadable',
}, this.opts);
// use importName from opts, default to 'react-loader'
if (source !== opts.importName) return;
var defaultSpecifier = path.get('specifiers').find(function (specifier) {
return specifier.isImportDefaultSpecifier();
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const publicRoutes = [
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const publicRoutes = [
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
// Root routes
const rootRoutes = [
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
import steps from 'datasets/ui/dashboard/dataset-stepper/steps';
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const steps = [
{
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
import steps from 'descriptorlists/ui/dashboard/descriptorlist-stepper/steps';
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const steps = [
{
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
import { ROLE_ADMINISTRATOR, ROLE_USER } from 'constants/userRoles';
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const publicRoutes = [
// Root
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const publicRoutes = [
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const publicRoutes = [
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const publicRoutes = [
{
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
import { ROLE_ADMINISTRATOR, ROLE_USER } from 'constants/userRoles';
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
export const publicRoutes = [
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
import steps from 'requests/ui/request-stepper/steps';
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const steps = [
{
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
import steps from 'subsets/ui/dashboard/subset-stepper/steps';
......
import Loadable from 'utilities/LoadableUtil';
import Loadable from 'utilities/CustomReactLoadable';
const steps = [
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment