GithubHelp home page GithubHelp logo

Comments (6)

dignifiedquire avatar dignifiedquire commented on July 28, 2024 1

Thanks, helped me!

from bundle-loader.

fabiomcosta avatar fabiomcosta commented on July 28, 2024 1

Given you can also give a name to the bundle (ex: 'bundle-loader?lazy&name=bundle-name!./path), a more correct regexp would be:

module.name_mapper='^bundle-loader\?lazy[^!]*!\(.*\)$' -> '\1'

Thank you for the pointers!

from bundle-loader.

alexander-akait avatar alexander-akait commented on July 28, 2024

@sapottier why your need flow here? can your provide example use case?

from bundle-loader.

sapottier avatar sapottier commented on July 28, 2024

A small example who return 'Required module not fund' without the option.

// @flow
type routes = Array<{
  path: string,
  content: any, 
  header?: any,
  sidebar?: any,
  default?: boolean,
  restricted?: boolean | Array<string>,
  routes?: routes
}>;

import Example from 'bundle-loader?lazy!../views/Example/Example';
import Of from 'bundle-loader?lazy!../views/Of/Of';
import NestedRoute from 'bundle-loader?lazy!../views/NestedRoute/NestedRoute';

export const routerConfig: routes = [{
  path: '',
  content: Example,
  routes: [
    {
      path: 'example',
      content: Example,
      routes: [
        {
          path: 'of',
          content: Of,
          routes: [
            {
              path: 'nested-route',
              content: NestedRoute
            }
          ]
        }
      ]
    }
  ]
}];

from bundle-loader.

alexander-akait avatar alexander-akait commented on July 28, 2024

@sapottier What do you expect and what do you get (error, unexpected behavior)?

from bundle-loader.

sapottier avatar sapottier commented on July 28, 2024

Sorry, I have to be more precise. (sorry for my english)

Everything works well, except that when we use Flow, It does not understand 'bundle-loader?lazy!…' and return un error like 'Required module not fund'. To bypass this, a simple way is to configure Flow like previously explain. Also, maybe there is more to do by providing a flow-typed definition.

thank you,

Simon

from bundle-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.