Comments (11)
@enuchi Thank you for your repo. I can reproduce this issue.
I will address this issue.
from gas-webpack-plugin.
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.
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:
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.
I'm experiencing exactly same issue with autoGlobalExportsFiles option as @enuchi reported. I'm using CMD terminal in VS Code on Windows
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.
from gas-webpack-plugin.
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
tooptimization.minimize
(Optional, if you no need minify)
from gas-webpack-plugin.
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.
@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.
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.
Hi @enuchi @SeraClinic
I published [email protected].
from gas-webpack-plugin.
Much appreciate for your hard work!! :)
from gas-webpack-plugin.
Thanks again @fossamagna!!
from gas-webpack-plugin.
Related Issues (20)
- ERROR in chunk main [entry] HOT 6
- Does your script support classes HOT 3
- Production mode HOT 6
- Webpack-cli required
- Property accessors doesn't work.
- Google Apps Script: ReferenceError: "global" is not defined HOT 10
- Cannot read property 'getChunkModules' of undefined HOT 3
- Question - Automatically generating a typescript interface for the global functions HOT 29
- Remove JS Doc comments from custom function defintion
- README: `Script function not found: doGet` - special requirements for gas-webapps? HOT 12
- Use GitHub Actions
- Fails to parse access to import.meta HOT 2
- GasPlugin cannot be used with decorators HOT 6
- add `include` option in order to define path patterns to detect functions
- Default includePatterns broken in v2.2.0 HOT 2
- Error ReferenceError: module is not defined (anonymous) @ echo:gs.1 HOT 4
- `autoGlobalExportsFiles` not working with ECMAScript HOT 5
- named export of a `const` function inside the declaration isn't exported to global
- `autoGlobalExportsFiles` options does not work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gas-webpack-plugin.