Git Product home page Git Product logo

Comments (5)

domenic avatar domenic commented on May 19, 2024 1

Yep, that's included :). See https://github.com/domenic/package-name-maps#basic-url-mapping

from import-maps.

domenic avatar domenic commented on May 19, 2024

I'm not sure I quite understand, but did you see from the readme how a package already consists of multiple modules, only one of which is the main module? That should cover the many-module packages like lodash.

from import-maps.

bahrus avatar bahrus commented on May 19, 2024

I'm sure I'm the one who doesn't understand:

I just want to make sure than application developer can write in a JavaScript file that gets shipped to the browser, with this syntax:

import {isDate} from 'lodash/isDate.js';
import {isRegularExpression} from 'lodash/isRegExp.js';

That with the help of a package map, the browser will be able to make a single http request, to a single bundled file of the lodash library.

And to do so with a single configuration line, rather than one line per file.

from import-maps.

dcleao avatar dcleao commented on May 19, 2024

It looks like the referenced anchor #basic-url-mapping no longer exists.

In any case, I think that the feature being requested by @bahrus is not supported by the current proposal, if I understood his request well. What I think @bahrus is asking for is support for bundle files which include several distinct modules... However, the ES6 module format does not support such thing as an inline modules, which would make it possible to ship several modules in a single file.

What import maps support is mapping several sub-modules of a package by mapping only a single base entry, as explained in packages via trailing slashes.

from import-maps.

domenic avatar domenic commented on May 19, 2024

Ah, yes, packaging up multiple files into one file is not part of import maps. Instead, check out https://github.com/WICG/webpackage.

from import-maps.

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.