Giter VIP home page Giter VIP logo

Comments (11)

fossamagna avatar fossamagna commented on May 29, 2024 1

@enuchi Thank you for your repo. I can reproduce this issue.
I will address this issue.

from gas-webpack-plugin.

fossamagna avatar fossamagna commented on May 29, 2024

Hi, @enuchi Thanks for submitting it. Is your project publicly available? I want to see how it is configured to understand how to solve this problem. If not, can you create a small repo on GitHub that replicates your project configuration ?

from gas-webpack-plugin.

enuchi avatar enuchi commented on May 29, 2024

Thanks @fossamagna , yes just created small repo that replicates the issue here: https://github.com/enuchi/ts-loader-test

Run npm install and then npm run build -- it will create the file in dist/code.js. Note the malformed text replacement in the generated code on lines 70-72:

https://github.com/enuchi/ts-loader-test/blob/3ee1f076f8d9242e8af505b76be4f0769fee20fe/dist/code.js#L70-L72

Looks like the global assignment snippet that are generated are not being appended to the end of the code, but a little before and cut off the variable name. (And not sure if this global assignment is actually needed since the functions are exposed at global level.) Let me know if anything else looks off with the configuration. Thank you for the help on this!

from gas-webpack-plugin.

SeraClinic avatar SeraClinic commented on May 29, 2024

I'm experiencing exactly same issue with autoGlobalExportsFiles option as @enuchi reported. I'm using CMD terminal in VS Code on Windows

image

As seen in the image above, letters get mingled when the plugin assigns global variables to "global' object, and interestingly, the way letters get mingled is slightly different when I build in WSL terminal in VS Code as below.

image

from gas-webpack-plugin.

fossamagna avatar fossamagna commented on May 29, 2024

@enuchi @SeraClinic

I have yet to find the root cause. However, the mode: none setting in webpack.config.js seems to be affecting this issue.
As a workaround, changing webpack.config.js as follows seems to prevent the issue.

  • Use production mode.
  • Set false to optimization.minimize (Optional, if you no need minify)

from gas-webpack-plugin.

enuchi avatar enuchi commented on May 29, 2024

Hi @fossamagna, thanks again for looking into this issue.

Unfortunately changing to production mode didn't work fully for me. When I try running the build in production mode, the generated code seems correct in the sample repo (that is, no variables are being cut off), but when I try to run the script in the spreadsheet it still errors out. I tried running the build in production mode in a separate project that has a lot more functions, and the "global" assignments are still being inserted in the middle of a variable string, so it may just be an accident in the minimal repo that it "looks" correct in production mode.

The only way I could get it to work here is if I manually fix the generated code so that the "global" assignments are not cutting off any variables.

from gas-webpack-plugin.

fossamagna avatar fossamagna commented on May 29, 2024

@enuchi Thank you for your feedback.
I published [email protected]. Would you be willing to try it?
I changed position of "global" assignments in this release.

from gas-webpack-plugin.

enuchi avatar enuchi commented on May 29, 2024

Hi @fossamagna -- thanks so much for the fast change! The beta version appears to work with my tests, both in the sample repo and in another repo I am testing with. Please let me know if you plan to publish as a new full release.

from gas-webpack-plugin.

fossamagna avatar fossamagna commented on May 29, 2024

Hi @enuchi @SeraClinic
I published [email protected].

from gas-webpack-plugin.

SeraClinic avatar SeraClinic commented on May 29, 2024

Much appreciate for your hard work!! :)

from gas-webpack-plugin.

enuchi avatar enuchi commented on May 29, 2024

Thanks again @fossamagna!!

from gas-webpack-plugin.

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.