Coder Social home page Coder Social logo

Comments (14)

garyxuehong avatar garyxuehong commented on June 12, 2024 3

Thank you for spending time investigate it. I am actually totally happy to have it compiled twice. Seeing multiple green 'success' displayed on screen makes me feel that my code is rock solid :)

from prettier-loader.

iamolegga avatar iamolegga commented on June 12, 2024 3

Hi, sorry for so late, it's done in watch-mode-fix branch, but I want to be sure with this, and I would like to take just a couple of days for more testing before merge it to master

from prettier-loader.

iamolegga avatar iamolegga commented on June 12, 2024 2

Sorry for delay, I could not find a lot of time for solving this problem before.

But I have time on next week, so I think somehow this will be done.

from prettier-loader.

iamolegga avatar iamolegga commented on June 12, 2024

Hi, sorry for late, found this issue just now :) I'll try to do something with it

from prettier-loader.

iamolegga avatar iamolegga commented on June 12, 2024

I'll try to figure out the problem:
user save changes to file -> here comes first compilation
if loader sees that file should be formatted, it overwrites the file -> here comes next compilation

Seems like it's not possible to solve this problem by only loader, according to loader api you can not prevent already started compilation.

But, I think this is where we can create plugin, that prevents second compilation.
And this is what you will add only to your dev config of webpack.

Need more time to solve this problem.

from prettier-loader.

iamolegga avatar iamolegga commented on June 12, 2024

Webpack team add new documentation on loaders api, so it seems like .pitch should help to solve this problen

I'll take a look in next few days

from prettier-loader.

enzoferey avatar enzoferey commented on June 12, 2024

How the research is going ? Really looking forward it :)

Amazing loader btw, saved me a lot of headaches with pre commit setup inside Docker 👍

from prettier-loader.

enzoferey avatar enzoferey commented on June 12, 2024

Hi ! How is it going ? Looking forward it 😄

from prettier-loader.

Deadly0 avatar Deadly0 commented on June 12, 2024

@iamolegga hi, will you merge the fix? Maybe publish beta version with the fix to npm?

from prettier-loader.

iamolegga avatar iamolegga commented on June 12, 2024

@Deadly0 I tested this, but had some issues with webpack 4, so that's why I didn't merge it yet. Now I'm on vacation, and I have not access to npm, so more time is required

from prettier-loader.

sola92 avatar sola92 commented on June 12, 2024

@iamolegga any luck with this?

from prettier-loader.

dsktschy avatar dsktschy commented on June 12, 2024

Any solution for this?

from prettier-loader.

iamolegga avatar iamolegga commented on June 12, 2024

Hi everyone, first of all, I'm so sorry for making you waiting so much time for solving this.

Last 2-3 days I was working only on this problem trying to solve this old bug. I've read all the webpack API docs, I've tried different ways, but no luck. With current webpack API it seems like it's not solvable.

More over webpack maintainers saying that loaders should not do things like this loader does (webpack/webpack#9763) 🤷‍♂️

I've looked at other similat projects, but no one has solution.

So I'm going to add this as knowing issue in docs, and closing it for now.

Sorry

from prettier-loader.

madnilo avatar madnilo commented on June 12, 2024

Anyone found a good alternative to this?
I am using the package in my project, and wondering what else is out there.

from prettier-loader.

Related Issues (13)

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.