-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How could I split dependencies in chunks? #7
Comments
@sneko Interesting! I had not really considered the benefits of chunking a k6 test to prevent rewrites of the dependencies. I'll have a look and get back to you. Would you mind disclosing a couple of the modules you are using so that I'll be able to recreate your circumstances? |
Any news in this one? I use edit: the issue seems to be coming from
this is the patch file: diff --git a/node_modules/form-data/lib/browser.js b/node_modules/form-data/lib/browser.js
index 09e7c70..0f2c8e4 100644
--- a/node_modules/form-data/lib/browser.js
+++ b/node_modules/form-data/lib/browser.js
@@ -1,2 +1,2 @@
/* eslint-env browser */
-module.exports = typeof self == 'object' ? self.FormData : window.FormData;
+module.exports = typeof self == 'object' ? self.FormData : typeof window !='undefined' ? window.FormData : undefined;
|
@simskij my setup with webpack config is
this should output the dependencies as a separate file in |
Hi @simskij ,
I'm struggling with making your template working with chunking files.
It works great when each output script embeds everything (its own imports) in its final .js file, but it makes my computer rewriting each time this full file for nothing (because only my k6 scenario changes, not imported dependencies).
The idea has been to add:
So dependencies are in their own final .js file and are imported by the scenario files (test1.js and test2.js in your example). But... I get this error:
Indeed this line will break:
It seems to be necessary to append dependencies...
since we are not in a real browser when executing the scenario... I tried multiple possibilities but never succeed. Setting
target=node
is not working also to prevent compiling dependencies with browser stuff.Do you know a workaround so I can chunk common files while being able to import them?
Thank you,
The text was updated successfully, but these errors were encountered: