stipsan / bulma-loader

A Webpack loader for Bulma, a modern CSS framework based on Flexbox
35 stars 3 forks source link

Error in bulma/css/bulma.css #34

Closed code4cake closed 6 years ago

code4cake commented 6 years ago

hey guys I'm trying to use bulma and bulma-loader on my project with nextjs, but I keep getting this parsing error:

 Module parse failed: /Users/solisd01/Code/projects/OpenSource/startsprung/portfolio/node_modules/bulma/css/bulma.css Unexpected character '@' (2:0) You may need an appropriate loader to handle this file type. | /*! bulma.io v0.6.1 | MIT License | github.com/jgthms/bulma */ | @-webkit-keyframes spinAround { | from { | -webkit-transform: rotate(0deg);

here is webpack config file.

const path = require("path");
const glob = require("glob");

module.exports = {
  webpack: (config, { dev }) => {
    config.module.rules.push(
      {
        test: /\.sass$/,
        loaders: [ 'style-loader', 'css-loader?modules&importLoaders=2', 'sass-loader', 'bulma?theme=sass/bulma.sass'
          // { loader: 'css-loader', options: { importLoaders: 1 } }
        ]
      }
    )
    return config;
  }
}

Thanks

stipsan commented 6 years ago

Somehow something wants to load .css. For that you need to either setup a css-loader, or configure your bulma.sass file to only import .sass files 😄

code4cake commented 6 years ago

@stipsan This is what I have now, am I missing something?

#next.config.js
const path = require("path");
const glob = require("glob");

module.exports = {
  webpack: (config, { dev }) => {
    config.module.rules.push(
      {
        // test: /\.(sass|scss)$/,
        test: /\.(sass|scss)$/,
        loaders: [ 'style-loader', 'css-loader?modules&importLoaders=2', 'sass-loader', 'bulma?theme=sass/bulma.sass'
          // { loader: 'css-loader', options: { importLoaders: 1 } }
        ]
      }
    )
    return config;
  }
}
# ./sass/bulma.sass // => empty file
# ./sections/styles.scss 

But still getting the

Error in !!../node_modules/css-loader/index.js?modules&importLoaders=2!../node_modules/sass-loader/lib/loader.js!../node_modules/bulma/bulma.sass?theme=sass/bulma.sass!./styles.scss
Module build failed: Error: Cannot find module 'node-sass'
stipsan commented 6 years ago

https://github.com/stipsan/bulma-loader#this-project-is-no-longer-maintained