-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Gridsome] ModuleBuildError: Module build failed #1
Comments
I did some research and apparently Gridsome CLI generated projects seem to pull in
const { getLocalIdentName } = require("css-loader-shorter-classnames");
const isProduction = process.env.NODE_ENV === "production";
module.exports = {
// ... other config options
css: {
loaderOptions: {
css: {
localIdentName: "[local]-[hash:base64:8]",
...(isProduction ? { getLocalIdent: getLocalIdentName() } : {}),
},
},
},
}; Attaching sample project with working configuration. |
Hello @unematiii!! You're amazing, really thank you for your quick reply. I took your sample project, I added the Buefy and imported into the main.js. If you try to do Here is the updated sample project. Really thank you for the help! |
Hey! Actually everything in Vue SFC-s do get correct class names. I guess module.exports = {
// ... other config options
css: {
loaderOptions: {
css: {
modules: true,
localIdentName: "[local]-[hash:base64:8]",
...(isProduction ? { getLocalIdent: getLocalIdentName() } : {}),
},
},
},
}; But beware, enabling modules for external libraries can cause some problems: if you yourself or the JS implementation of the library rely on static class names. Then you should use different configuration for the styles in you app and for those of external libraries. |
@unematiii it's now working 😄 really thank you for all the help!!! |
Hello @unematiii 🙂
First of all, really thank you for this work and contribution to the community!
I've tried this package and some other methods but nothing seems to work. I spend some hours around this but I was not able to find a solution.
I was trying to reduce the CSS class names as Bulma has long names. I'm sure it will reduce heavily the CSS file size. I'm using Gridsome and Buefy.
Attached is a file with all the methods I've tried and the result and errors from them. You can also check it here http://pastie.org/p/1wpSI1AMvK3T6MZ23tXsLB.
I've sent this to another developer to see if it was working from his side but he faced the same problems.
Not sure if is Gridsome, Buefy, SASS fault or something else.
Really thank you and have a beautiful week 😄
debug.js.zip
The text was updated successfully, but these errors were encountered: