Error: Cannot find module ‘gulp-sass’
Just do npm update and then npm install gulp-sass –save-dev in your root folder, and then when you run you shouldn’t have any issues.
Just do npm update and then npm install gulp-sass –save-dev in your root folder, and then when you run you shouldn’t have any issues.
I had similar issue when I installed locally initially(w/o -g). I reinstalled with -g (global) and then it worked. npm install -g gulp you should run gulp from folder where gulpfile.js is available.
Had the same issue. For me, updating node didn’t work but adding this at the very beginning of my gulpfile did: require(‘es6-promise’).polyfill();
Older versions of Babel came with everything out of the box. The newer version requires you install whichever plugins your setup needs. First, you’ll need to install the ES2015 preset. npm install babel-preset-es2015 –save-dev Next, you need to tell babelify to use the preset you installed. return browserify({ … }) .transform(babelify.configure({ presets: [“es2015”] })) … … Read more
To achieve this please specify base. ΒΆ base – Specify the folder relative to the cwd. Default is where the glob begins. This is used to determine the file names when saving in .dest() In your case it would be: gulp.task(‘move-css’,function(){ return gulp.src([ ‘./source/css/one.css’, ‘./source/other/css/two.css’ ], {base: ‘./source/’}) .pipe(gulp.dest(‘./public/assets/’)); }); Folder structure: . βββ gulpfile.js … Read more
You only need to install babel-preset-es2015: CLI usage example: npm install babel-cli babel-preset-es2015
As pointed out in the doc, you should install it globally (you did that) and add it to your project dev deps (locally): npm install gulp –save-dev
While Liviu Costea’s answer is correct, it still took me quite some time to figure out how it is actually done. So here is my step-by-step guide starting from a new ASP.NET 4.5.2 MVC project. This guide includes client-side package management using bower but does not (yet) cover bundling/grunt/gulp. Step 1 (Create Project) Create a … Read more
Not the answer, but applicable to this question’s appearance in search results. To copy files/folders in gulp gulp.task(‘copy’, () => gulp .src(‘index.js’) .pipe(gulp.dest(‘dist’)) );
As ChrisR mentionned, UglifyJS does not support ES6 at all. You need to use terser-webpack-plugin for ES6 (webpack@5 will use this plugin for uglification) npm install terser-webpack-plugin –save-dev Then define in your plugins array const TerserPlugin = require(‘terser-webpack-plugin’) new TerserPlugin({ parallel: true, terserOptions: { ecma: 6, }, }), Source