Skip to content

Explain generate_import #10

@ipepe

Description

@ipepe

Could You explain the usage of mid and path?

      def generate_import(import)
        package, mid, path = import[:package].partition('.')
        "  var #{import[:identifier]} = require(#{package.to_json})#{mid}#{path};\n"
      end

Because I have problem when requesting dependency './index.js' and have been wondering about refactoring that piece of code or adding local_dependency

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions