Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump gulp from 4.0.2 to 5.0.0 #4949

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def remove_sass_files():


def remove_gulp_files():
file_names = ["gulpfile.js"]
file_names = ["gulpfile.mjs"]
for file_name in file_names:
os.remove(file_name)

Expand Down Expand Up @@ -179,7 +179,7 @@ def handle_js_runner(choice, use_docker, use_async):
remove_keys=["babel"],
scripts={
"dev": "gulp",
"build": "gulp generate-assets",
"build": "gulp build",
},
)
remove_webpack_files()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,47 @@
////////////////////////////////

// Gulp and package
const { src, dest, parallel, series, watch } = require('gulp');
const pjson = require('./package.json');
import { src, dest, parallel, series, task, watch } from 'gulp';
import pjson from './package.json' with {type: 'json'};

// Plugins
const autoprefixer = require('autoprefixer');
const browserSync = require('browser-sync').create();
const concat = require('gulp-concat');
const tildeImporter = require('node-sass-tilde-importer');
const cssnano = require('cssnano');
const imagemin = require('gulp-imagemin');
const pixrem = require('pixrem');
const plumber = require('gulp-plumber');
const postcss = require('gulp-postcss');
import autoprefixer from 'autoprefixer';
import browserSyncLib from 'browser-sync';
import concat from 'gulp-concat';
import tildeImporter from 'node-sass-tilde-importer';
import cssnano from 'cssnano';
import imagemin from 'gulp-imagemin';
import pixrem from 'pixrem';
import plumber from 'gulp-plumber';
import postcss from 'gulp-postcss';
import rename from 'gulp-rename';
import gulpSass from 'gulp-sass';
import * as dartSass from 'sass';
import gulUglifyES from 'gulp-uglify-es';
import { spawn } from 'node:child_process';

const browserSync = browserSyncLib.create();
const reload = browserSync.reload;
const rename = require('gulp-rename');
const sass = require('gulp-sass')(require('sass'));
const spawn = require('child_process').spawn;
const uglify = require('gulp-uglify-es').default;
const sass = gulpSass(dartSass);
const uglify = gulUglifyES.default;

// Relative paths function
function pathsConfig(appName) {
this.app = `./${pjson.name}`;
function pathsConfig() {
const appName = `./${pjson.name}`;
const vendorsRoot = 'node_modules';

return {
vendorsJs: [
`${vendorsRoot}/@popperjs/core/dist/umd/popper.js`,
`${vendorsRoot}/bootstrap/dist/js/bootstrap.js`,
],
app: this.app,
templates: `${this.app}/templates`,
css: `${this.app}/static/css`,
sass: `${this.app}/static/sass`,
fonts: `${this.app}/static/fonts`,
images: `${this.app}/static/images`,
js: `${this.app}/static/js`,
app: appName,
templates: `${appName}/templates`,
css: `${appName}/static/css`,
sass: `${appName}/static/sass`,
fonts: `${appName}/static/fonts`,
images: `${appName}/static/images`,
js: `${appName}/static/js`,
};
}

Expand Down Expand Up @@ -163,7 +168,7 @@ function watchPaths() {
}

// Generate all assets
const generateAssets = parallel(styles, scripts, vendorScripts, imgCompression);
const build = parallel(styles, scripts, vendorScripts, imgCompression);

// Set up dev environment
{%- if cookiecutter.use_docker == 'n' %}
Expand All @@ -176,6 +181,6 @@ const dev = parallel(runServer, initBrowserSync, watchPaths);
const dev = parallel(initBrowserSync, watchPaths);
{%- endif %}

exports.default = series(generateAssets, dev);
exports['generate-assets'] = generateAssets;
exports['dev'] = dev;
task('default', series(build, dev));
task('build', build);
task('dev', dev);
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"gulp-concat": "^2.6.1",
"concurrently": "^9.0.0",
"cssnano": "^7.0.0",
"gulp": "^4.0.2",
"gulp": "^5.0.0",
"gulp-imagemin": "^7.1.0",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^10.0.0",
Expand Down