Closed RomkaLTU closed 2 years ago
Additional info on this:
I copied swiper.min.css from node_modules and placed it in styles folder and imported it, no errors then. But same file imported from node_modules ('../../node_modules/swiper/swiper.min.css') complaining about loaders.
import '@styles/swiper.css'; // works
import '../../node_modules/swiper/swiper.min.css'; // doesn't work
this is by design. bud.js only transpiles code in your @src
directory, by default.
see documentation on transpiler sources: https://bud.js.org/guides/general-use/transpiler-sources
You want to add something like this:
/**
* Allow transpiling swiper css source
*/
.build.rules.css.setInclude((paths) => [
...paths,
app.path("@modules/swiper"),
]);
The benefit of this is that we're not applying postcss/babel/etc. to all files in the project, most of which don't need them applied. It saves a lot of time.
Agreement
Describe the issue
Can't compile any css, scss file imported to app.js bud doctor returning unknown error "TypeError: Cannot read properties of undefined (reading 'toWebpack')"
When trying to import
import 'swiper/css';
I'm getting an error:This is a CSS file, anyway installed scss loader, same error when trying to import .scss.
Expected Behavior
Everything should compile without errors.
Actual Behavior
Complaining about missing loaders, some unclear errors when running bug doctor.
Steps To Reproduce
version
6.3.5
What package manager are you using?
yarn
version
1.22.17
Logs
Configuration
Relevant .budfiles
No response