Git Product home page Git Product logo

Comments (5)

egoist avatar egoist commented on July 27, 2024 6

Does @import "react-input-range/src/scss/index.scss"; work in regular node-sass? From what I can tell it's importing a file relative to cwd instead of the one in node_modules.

However I think you can use includePaths option to make this work:

postcss({
	use: [
		['sass', {
			includePaths: [path.resolve('node_modules')]
		}]
	]
})

from rollup-plugin-postcss.

egoist avatar egoist commented on July 27, 2024 4

btw in v1.3.0 you can prepend it with ~ to import from node_modules, see: https://github.com/egoist/rollup-plugin-postcss#imports

from rollup-plugin-postcss.

drewlustro avatar drewlustro commented on July 27, 2024 2

This is working for me!

postcss({
  modules: true,
  extensions: ['.css', '.sass', '.scss'],
  namedExports: true,
  use: [
    [
      'sass', {
        includePaths: [path.join(__dirname, 'scss')]
      }
    ]
  ]
})

from rollup-plugin-postcss.

davegonzalez avatar davegonzalez commented on July 27, 2024

@davidungio I also ran into this today. What worked for me was to prefix the the import with node_modules. so in my case, I had to do:

@import "node_modules/@vhx/adventurine";

rather than

@import "@vhx/adventurine";

from rollup-plugin-postcss.

u3u avatar u3u commented on July 27, 2024

I also encountered this problem. I used bili to configure includePaths

// bili.config.js
const path = require('path');

module.exports = {
  postcss: {
    use: [
      [
        'sass',
        {
          includePaths: [path.resolve('node_modules')],
        },
      ],
    ],
  },
};

but this error occurred:

$ bili

🚨(postcss) /xxx/xxx.scss:1:0: Unknown word
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser

🤔Is my configuration wrong?

from rollup-plugin-postcss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.