Akaev Dzhalal
Akaev Dzhalal

Reputation: 129

import javascript parts in main js file

Good day, I have a webpack assembly. There are also two script files, one of them is the main one, it is also connected to the page, and the second is for some settings. So I registered the settings I needed in this file and I want to import it into the main file, but I can’t do it. Tell me how to implement such an import

My settings js file

const burger = document.querySelector('.burger')
const menuIsActive = false

function menuOpen() {
  burger.classList.toggle('burger--active')
}

burger.addEventListener('click', menuOpen)

Upvotes: 0

Views: 40

Answers (1)

Akaev Dzhalal
Akaev Dzhalal

Reputation: 129

I wrote the import like this import "nav.js" instead of this import "./nav.js"

Upvotes: 1

Related Questions