Install gulp-sass separately
npm install sass gulp-sass --save-dev
In gulpfile.js file
const gulp = require('gulp');
// const sass = require('gulp-sass');
var sass = require('gulp-sass')(require('sass'));//sass-css
My gulpfile.js is configured as follows
const gulp = require('gulp');
// const sass = require('gulp-sass'); //sass-css
var sass = require('gulp-sass')(require('sass'));
const minifyCSS = require('gulp-minify-css')
gulp.task('sass', async function () {
return gulp.src('components/css/**/*.scss').pipe(sass()).pipe(minifyCSS()).pipe(gulp.dest('dist/css'))
})
Configure the following in the packages file
{
"name": "garden-ui",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "npm run build:js && npm run build:css",
"lint": "vue-cli-service lint",
"build:js": "webpack --config ./webpack.config.js",
"build:css": "npx gulp sass"
},
Execute npm run build:css
to compile successfully
Read More:
- [Solved] Gulp-sass Install Error: error: cannot find module ‘sass‘
- [Solved] npm install sass@~1.32 sass-loader deepmerge -D Install Error
- Module not found: Error: Can‘t resolve ‘sass-loader‘ in…
- Gulp compression error: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module…
- How to Fix Node SASS Error in Vue + webpack project after nodejs upgrade
- Module not found: Error: Can‘t resolve ‘sass-loader‘
- Module build failed: Error: Node Sass version 6.0.0 is incompatible with ^4.0.0
- [Solved] Vue cli version is @ Vue/cli 4.5.13, and sass is used to report an error
- NPM run dev Error Module build failed: Error: Cannot find module ‘node-sass’
- [Solved] ionic Build Error: Cannot load gulp tasks: Error: Error in module: .\gulpfile.js:
- An error was reported when Maven package was running the packaged jar package: there is no main list attribute in xxx.jar, which can be solved by configuring Maven plugin
- Springboot package error: failed to execute goal org.apache.maven.plugins:maven-resources-plugin: 3.2.0…
- [Solved] Fatal message conversion error; message rejected; it will be dropped or routed to a dead letter exchan
- Rtabmap Run Error: PluginlibFactory: The plugin for class ‘octomap_rviz_plugin/ColorOccupancyGrid‘ failed t
- [Solved] PluginlibFactory: The plugin for class ‘rviz_imu_plugin/IMU‘ failed to load.
- Unity Package Webgl Error: Failed running “D:\Program Files\Unity2018.3.0f2\Unity\Editor\Data\PlaybackEngines\Web
- [Solved] Unity Package Error: Failed running D:\Program Files\Unity2018.4.1\Editor\Data\il2cpp/build/il2cpp.exe
- Webpack Pack and compress ES6 files with errors: ERROR in js/xxxxxx.js from UglifyJs Unexpected token punc ()
- [Solved] Executing npm install error: npm ERR! code EINTEGRITY