sass-loader

Webpack SASS-loader include statement breaks SASS @import statemetns

ぐ巨炮叔叔 提交于 2021-02-07 20:47:37
问题 So for background originally I was excluding the node_modules directory in my Webpack config, which was working fine for my sass @import statements, but made it very difficult to include things from the node_modules directory. So I switched the SASS loader to the following { test: /\.scss$/, include: [path.resolve(__dirname, "/src/client"), path.resolve(__dirname, "/node_modules/angular-material/")], loader: 'style-loader!css-loader!autoprefixer-loader!sass-loader' }, Please also note I tried

Webpack SASS-loader include statement breaks SASS @import statemetns

我与影子孤独终老i 提交于 2021-02-07 20:45:31
问题 So for background originally I was excluding the node_modules directory in my Webpack config, which was working fine for my sass @import statements, but made it very difficult to include things from the node_modules directory. So I switched the SASS loader to the following { test: /\.scss$/, include: [path.resolve(__dirname, "/src/client"), path.resolve(__dirname, "/node_modules/angular-material/")], loader: 'style-loader!css-loader!autoprefixer-loader!sass-loader' }, Please also note I tried

Webpack SASS-loader include statement breaks SASS @import statemetns

僤鯓⒐⒋嵵緔 提交于 2021-02-07 20:43:35
问题 So for background originally I was excluding the node_modules directory in my Webpack config, which was working fine for my sass @import statements, but made it very difficult to include things from the node_modules directory. So I switched the SASS loader to the following { test: /\.scss$/, include: [path.resolve(__dirname, "/src/client"), path.resolve(__dirname, "/node_modules/angular-material/")], loader: 'style-loader!css-loader!autoprefixer-loader!sass-loader' }, Please also note I tried

Webpack 4 build with Angular 7 gives problem with the sass-loader when trying to access to node_modules

主宰稳场 提交于 2020-12-04 08:57:19
问题 I was working on a upgrade from Angular v4 to v7. There are some breaking changes due to the .angular-cli.json to angular.json and their structure. And then also upgrading the versions of angular and webpack has its impact. In Angular 4 it has worked fine with the custom webpack builder but upgrading to v7 has its complications. It is also worth mentioning that trying the build without any @imports in the scss on the node_modules that I use does work as expected too. So I see that the issue

Webpack 4 build with Angular 7 gives problem with the sass-loader when trying to access to node_modules

折月煮酒 提交于 2020-12-04 08:56:30
问题 I was working on a upgrade from Angular v4 to v7. There are some breaking changes due to the .angular-cli.json to angular.json and their structure. And then also upgrading the versions of angular and webpack has its impact. In Angular 4 it has worked fine with the custom webpack builder but upgrading to v7 has its complications. It is also worth mentioning that trying the build without any @imports in the scss on the node_modules that I use does work as expected too. So I see that the issue

Using css variables in sass functions - node-sass

你说的曾经没有我的故事 提交于 2020-07-20 07:12:28
问题 I am trying to use CSS variables in an Angular project together with Sass functions ( lighten() / darken() to be precise), and as far as I know, the latest version of LibSass allows it. I have installed node-sass@4.11.0 and sass-loader@7.1.0 (and on Angular v7.3.0), but yet I receive an error Argument $color of lighten($color, $amount) must be a color Am I missing something? Thanks! 回答1: Unfortunately you can't... lighten is a SASS function at compile-time, while CSS variables are run-time

Webpack loader configuration to load css and sass files for React JS

北慕城南 提交于 2020-07-09 11:57:30
问题 I have installed react-h5-audio-player in a React app made with create-react-app and it worked fine. I did same to customized React project and I am being asked to configure webpack to load the css files. webpack.config.js module.exports = { module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: "babel-loader" } } ] } }; I have attached screenshot of error log and code section where error happened The error ( ERROR in ./node_modules/react-h5-audio-player/lib/styles.css 1

Webpack loader configuration to load css and sass files for React JS

北慕城南 提交于 2020-07-09 11:57:07
问题 I have installed react-h5-audio-player in a React app made with create-react-app and it worked fine. I did same to customized React project and I am being asked to configure webpack to load the css files. webpack.config.js module.exports = { module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: "babel-loader" } } ] } }; I have attached screenshot of error log and code section where error happened The error ( ERROR in ./node_modules/react-h5-audio-player/lib/styles.css 1

Slow sass-loader Build Times with Webpack

筅森魡賤 提交于 2020-06-10 08:45:29
问题 Summary When we switched to using Webpack for handling our SASS files, we noticed that our build times in some cases became really slow. After measuring the performance of different parts of the build using the SpeedMeasurePlugin, it seems that sass-loader is the culprit…it can easily take 10s to build (it used to take 20s before we made some fixes), which is longer than we’d like. I’m curious if people have additional strategies for optimizing building Sass assets that I didn’t cover. I’ve

Is there any way to use sass instead of node-sass (default for sass-loader) in Nuxt.js?

痞子三分冷 提交于 2020-05-18 04:30:09
问题 I'm trying to use sass package instead of node-sass in Nuxt.js. I found a config like this; // vue.config.js module.exports = { css: { loaderOptions: { sass: { implementation: require('sass'), // This line must in sass option }, }, } } but I couldn't figure out where to put this code in Nuxt.js. 回答1: Its already pointed on documentation. nuxt.config.js : build: { ... loaders: { sass: { implementation: require('sass') }, scss: { implementation: require('sass') } } ... } 来源: https:/