Skip to content

After ejecting, unsure of how to add Bourbon / Neat to webpack聽#837

Description

@lukerollans

I am migrating an existing, server-rendered front-end to a React app. Woo! 馃帀

It's my first pure javascript front-end, so I'm a little rusty with things like webpack. I need to bring over Bourbon and Neat which I previously setup in Brunch, so I understand the necessity for include paths etc.

After ejecting, I made the following modifications..

package.json

"devDependencies": {
    ...
    "bourbon": "^4.2.7",
    "bourbon-neat": "^1.8.0",
    ...
}

config/paths.js

// config after eject: we're in ./config/
module.exports = {
  ...
  appSrc: resolveApp('src'),
  bourbon: require("bourbon").includePaths,
  bourbonNeat: require("bourbon-neat").includePaths,
  ...
};

config/webpack.config.dev.js (after also installing node-sass which is working great)

// SASS compatibility!
{
  test: /\.scss/,
  include: [
    paths.bourbon,
    paths.bourbonNeat,
    paths.appSrc
  ],
  loaders: ["style", "css", "sass"]
},

After this, it's my understanding that simply @import "bourbon" from App.scss should work, but I'm getting.

Failed to compile.

Error in ./src/App.scss
Module build failed:
@import "bourbon";
^
      File to import not found or unreadable: bourbon
Parent style sheet: stdin

Does anyone see where I might be going wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions