Question T14076
Visible to All Users

Combining SurveyJS Dependencies into a Single File

created a year ago

We have been using SurveyJS in our NodeJS and jQuery based application. Currently, our application relies on multiple files to incorporate SurveyJS into our project. Specifically, we are using the following files:

<script type="text/javascript" src="https://unpkg.com/knockout/build/output/knockout-latest.js"></script>
<link href="https://unpkg.com/survey-core/defaultV2.min.css" type="text/css" rel="stylesheet">
<script src="https://unpkg.com/survey-core/survey.core.min.js"></script>
<script src="https://unpkg.com/survey-knockout-ui/survey-knockout-ui.min.js"></script>
<link href="https://unpkg.com/survey-creator-core/survey-creator-core.min.css" type="text/css" rel="stylesheet">
<script src="https://unpkg.com/survey-creator-core/survey-creator-core.min.js"></script>
<script src="https://unpkg.com/survey-creator-knockout/survey-creator-knockout.min.js"></script>

While SurveyJS has been instrumental in meeting our survey needs, we have noticed that loading multiple files increases the number of requests and affects our application's load time. Therefore, we are keen to explore ways to optimize the integration of SurveyJS into our project.

If such an option is available or if there are any recommended approaches to achieve this, we would greatly appreciate your guidance.

Answers approved by surveyjs Support

created a year ago

Hello Nirbhay,
You can use bundling tools like Webpack to combine your JavaScript and CSS files, including SurveyJS, into a single file each. This reduces the number of HTTP requests needed to fetch individual files and also reduces the file size, improving load times.

Let me know if you have further questions.