Adding new SCSS file also adds .js file?

Hi all

I am adding a login.css file to style the wordpress login screen, but it’s also creating an extra login.js file and I can’t see why, my code is below:

In config.json:

{
  "entry": {
    "main": [
      "./scripts/main.js",
      "./styles/main.scss"
    ],
    "customizer": [
      "./scripts/customizer.js"
    ],
    "login": [
      "./styles/login.scss"
    ]
  },
  "publicPath": "/app/themes/test",
  "devUrl": "http://test.local",
  "proxyUrl": "http://localhost:3000",
  "cacheBusting": "[name]_[hash:8]",
  "watch": [
    "app/**/*.php",
    "config/**/*.php",
    "resources/views/**/*.php"
  ]
}

When I run yarn run build it also creates dist/scripts/login.js

Am I doing something wrong?

Thanks

@joeldenne - hadn’t noticed that before, but I can see the same thing on one of my projects. I don’t think you’re doing anything wrong.

Possibly related to this issue: https://github.com/roots/sage/issues/1911

1 Like

Thanks, @alwaysblank. That got me pointed in the right direction.

@joeldenne Seems to be a Webpack limitation (see the links below). I didn’t go far enough down the rabbit hole to see if there is a workaround–I’m not super familiar with Webpack.


Thanks for looking @mmirus and @alwaysblank.

Not a big deal, it’s not getting enqueued anywhere so will just have to ignore it until a fix is pushed :slight_smile:

Cheers

1 Like