Giter Site home page Giter Site logo

Comments (5)

alexander-akait avatar alexander-akait commented on June 11, 2024

What does an esModule mean in the context of file-loader?

From docs:

By default, file-loader generates JS modules that use the ES modules syntax. There are some cases in which using ES modules is beneficial, like in the case of module concatenation and tree shaking.

How would it be imported and used? Is it meant for end consumption (i.e. being a loader by itself), or is it more meant for chaining?

Always yes.

When would the features esModule enables (like tree-shaking) be used? We're primarily using file-loader for image references, and it isn't clear where or how tree-shaking would happen when your imports are singular.

How tree-shaking works is out of the repo.

You can find a lot of articles about tree shaking and import/export

from file-loader.

tstirrat15 avatar tstirrat15 commented on June 11, 2024

Always yes.

Is that yes to end consumption or is that yes to chaining? I think that would answer my question.

from file-loader.

rightaway avatar rightaway commented on June 11, 2024

Are we able to use import() function or only import statement? I get src="[object Promise]" as the output when I use import() even though I have esModule: true.

from file-loader.

alexander-akait avatar alexander-akait commented on June 11, 2024

@rightaway update html-loader to latest version

from file-loader.

rightaway avatar rightaway commented on June 11, 2024

I'm not using html-loader. You mean file-loader? I'm using latest 6.0.0. This is in a Vue template file btw.

from file-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.