# Create a new javascript file is doesn't work

**URL:** <https://forum.shopware.com/t/create-a-new-javascript-file-is-doesnt-work/106457>\
**Category:** Shopware 6 (English)\
**Created:** [10. Februar 2025 um 07:13 UTC](https://forum.shopware.com/t/create-a-new-javascript-file-is-doesnt-work/106457 "2025-02-10T07:13:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![code.bach](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@code.bach](https://forum.shopware.com/u/code.bach)\
**Post date:** [10. Februar 2025 um 07:13 UTC](https://forum.shopware.com/t/create-a-new-javascript-file-is-doesnt-work/106457/1 "2025-02-10T07:13:50Z")

</div>

Hello everyone,

I’m trying to redesign my own theme by creating my own scss & js files.  
First of all i’ve find this guide and followed every steps in it;

`https://developer.shopware.com/docs/guides/plugins/plugins/storefront/add-custom-javascript.html`

But still there’s some problem which is the compiler doesn’t compile my custom javascript file.

1- I’ve created theme.json `custom/plugins/JsCss/src/Resources/theme.json`  
2- main.js `custom/plugins/JsCss/src/Resources/app/storefront/src/main.js`  
path =\> `import '/js/script.js';`  
3- script.js `custom/plugins/JsCss/src/Resources/app/storefront/src/js/script.js`

```auto
    console.log("JsCss Plugin Loaded!");
    alert("JsCss is working!");
});

```

After all this changes i’ve tried to compile my theme via `bin/console theme:compile`  
Normally it should create some folder in public/bundles but it didn’t work so i need some help to fix it. Thanks for your time

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [10. Februar 2025 um 07:40 UTC](https://forum.shopware.com/t/create-a-new-javascript-file-is-doesnt-work/106457/2 "2025-02-10T07:40:06Z")

</div>

bin/console theme:compile is for compiling SCSS.

bin/build-storefront.sh is for compiling JS.

This is clearly written in the documentation you have mentioned.

---

<div class="post-metadata">

**Author:** ![code.dev](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@code.dev](https://forum.shopware.com/u/code.dev)\
**Post date:** [15. Februar 2025 um 10:49 UTC](https://forum.shopware.com/t/create-a-new-javascript-file-is-doesnt-work/106457/3 "2025-02-15T10:49:06Z")

</div>

Hi, During custom plugin development, we run the command `bin/console theme:compile` to compile SCSS. For JavaScript, you need to compile it using `bin/build-storefront.sh`, as mentioned here: [Shopware Developer Guide](https://developer.shopware.com/docs/guides/plugins/plugins/storefront/add-custom-javascript.html#testing-your-changes).
