I feel like im taking crazy pills.
I have tried a very simple example:
In my bud.config.mjs
:
/**
* Application entrypoints
*/
.entry({
app: ["@scripts/app", "@styles/app"],
editor: ["@scripts/editor", "@styles/editor"],
test: ['./test.js', './test.css']
})
This always loads both test files as .js
.
So I run yarn bud clean
and then yarn bud build
so I can take a look at the modules.json
within the .budfiles
directory.
The output in terminal:
◉ sage ./public [965c0d3aaa41af6c5bce]
│
├─ entrypoints
│ ├─ app
│ │ ├─ js/runtime.c9c28a.js 1.01 kB
│ │ ├─ js/575.fb8f9f.js 215 bytes
│ │ ├─ css/app.a8e10a.css 6.19 kB
│ │ └─ js/app.a340c8.js 274 bytes
│ ├─ editor
│ │ ├─ js/runtime.c9c28a.js 1.01 kB
│ │ ├─ js/575.fb8f9f.js 215 bytes
│ │ ├─ css/editor.31d6cf.css
│ │ └─ js/editor.51a65b.js 420 bytes
│ └─ test
│ ├─ js/runtime.c9c28a.js 1.01 kB
│ └─ js/test.c664ed.js 161 bytes
│
├─ assets
│ └─ images/.gitkeep.31d6cf
│
│
└─ compiled 27 modules in 2s 115ms
And then the contents of my manifest.json
file, where you can see the test files are not being picked up by the same loaders:
{
"chunks": {
"byName": {
"app": 143,
"editor": 189,
"runtime": 666,
"test": 43
},
"bySource": {
"0 app": 666,
"0 editor": 666,
"0 test": 666,
"1 app": 575,
"1 editor": 575,
"1 test": 43,
"2 app": 143,
"2 editor": 189
},
"usedIds": [
43,
143,
189,
575,
666
]
},
"modules": {
"byIdentifier": {
"./node_modules/babel-loader/lib/index.js??babel!./resources/scripts/app.js": 537,
"./node_modules/babel-loader/lib/index.js??babel!./resources/scripts/editor.js|f1d31d6f7a34c66ea56d009c9356170e": 784,
"./node_modules/mini-css-extract-plugin/dist/loader.js??minicss!./node_modules/css-loader/dist/cjs.js??css!./node_modules/postcss-loader/dist/cjs.js??postcss!./resources/styles/app.css": 362,
"./node_modules/mini-css-extract-plugin/dist/loader.js??minicss!./node_modules/css-loader/dist/cjs.js??css!./node_modules/postcss-loader/dist/cjs.js??postcss!./resources/styles/editor.css": 576,
"./test.css": 944,
"./test.js": 393,
"javascript/esm|./node_modules/@roots/sage/lib/client/dom-ready.js": 575
},
"usedIds": [
362,
393,
537,
575,
576,
784,
944
]
}
}
Question: Is this expected behavior? and if so, how would I go about applying the same loaders to js and CSS files that live outside the @scripts
and @styles
bud paths
Using:
"devDependencies": {
"@roots/bud": "6.4.3",
"@roots/bud-sass": "^6.4.3",
"@roots/bud-support": "6.4.3",
"@roots/bud-tailwindcss": "6.4.3",
"@roots/sage": "6.4.3"
}
And Sage version 10.2.0
Thanks!