Roots Discourse

BrowserSync Inject Multiple Entries

Hi Guys,

maybe someone faced similar issues reagarding BrowserSync, Webpack multiple entries and injecting sources…

I just haven’t found any solution yet, so sorry beforehand if there’s already a solution out there I haven’t noticed yet. :wink:

What I’am trying to achieve is as easy as it sounds: Have multiple entries within config.json e.g.

"main": [
      "./scripts/main.js",
      "./styles/_main.less",
    ],
    "base": [
      "./styles/_base.less"
    ],
]

The file _base.css is being generated, so no issues here, but the problem is, that this file is not being injected within the dev url & BrowserSync.

Are there any adjustments which I have to take into account or are there any code workarounds out there?

My actual workaround looks like this:

When in Dev mode, put all in one, and when deploy, just separate them… Not really a real world example though ;(

"entry": {
    "main": [
      "./scripts/main.js",
      "./styles/_main.less",
      "./styles/_base.less",
    ],
]

Thanks in Advance for any suggestions and solutions for this… :wink:

Kind
Michael