Git Product home page Git Product logo

Comments (3)

evanw avatar evanw commented on June 11, 2024 1

My guess is that Vite does a find and replace on __VITE_PRELOAD__ which breaks when the slash newline is introduced, but I can't say for sure.

That's my guess as well given your description, and given that I think I've read of Vite doing other things like that in the past. But that's not a problem with esbuild. If you need to post-process esbuild's output with such a tool, then perhaps you don't want to use the line limit setting? Either that or the other tool would have to be fixed.

from esbuild.

Xerios avatar Xerios commented on June 11, 2024

I was wondering if there wasn't already a way to preserve strings through either comment or some option in existing minifiers like terser, but I can't seem to find any. This is probably a very rare edge-case that I stumbled upon.

I'll make a cross-post to Vite to see if they can cover this edge-case.

from esbuild.

evanw avatar evanw commented on June 11, 2024

I'm closing this issue because this is not a problem with esbuild. The strings that esbuild is generating are still valid JavaScript strings. It makes sense that tools using regexp-based post-processing don't automatically work with JavaScript like that, but in that case you should be able to disable the line limit setting until the other tools are fixed (or if they decide that it's not a problem worth fixing).

from esbuild.

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.