Git Product home page Git Product logo

Comments (3)

filipesilva avatar filipesilva commented on August 15, 2024 1

For reference: https://github.com/webpack/webpack/tree/feature/pure-module/examples/pure-module

Doing this on the build-optimizer itself raises some problems. Build optimizer doesn't know about modules, and it actually doesn't know about file systems either. It only knows about file contents and (if given) file paths.

And this is relevant in a webpack context because the file contents for a given file path may or may not be related to that path on disk. For instance, the file may have been through some loaders already and it's current content changed, or the given file path may not even exist at all (this happens for AOT code).

The one that truly is aware of the pure-module flag is the system that is resolving the module - webpack in this case, maybe others in the future. So my suggestion is that we pass that information along in the build-optimizer call in the consumer:

const boOutput = buildOptimizer({ content: input, pure: true });

This way the module loader can tell build optimizer that it thinks this given module is pure, and build optimizer itself drops the whitelist and doesn't even bother checking the file path, which was a problematic way to detect these anyway.

from devkit.

IgorMinar avatar IgorMinar commented on August 15, 2024

from devkit.

alexeagle avatar alexeagle commented on August 15, 2024

This issue was moved to angular/angular-cli#12103

from devkit.

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.