Wildcard don't work in config.json

{
  "entry": {
    "main": [
      "./scripts/main.js",
      "./scripts/components/*.js", //this example currently does not compile & errors out
      "./styles/main.scss"
    ]
  },
}

In Gulp/Bower – manifest.json allows you to pass wildcards (aka folders of JS / SCSS files) to include for compilation; this is not currently possible in Sage 9.

In order to utilize config.json each individual file must be listed; this is inefficient and nonpragmatic.

It looks like this is a limitation of Webpack: https://github.com/webpack/webpack/issues/370 That thread also offers some relatively simple ways to address the issue. AFAIK the usual development method w/ Sage is to import or require additional scripts in main.js rather than importing them through config.json.

1 Like

Ah wonderful, thanks for pointing me in the right direction.