Does gulp have a function similar to webpack's alias?

such as configuration items like webpack

alias: {
    "@": resolve("src")
}

can gulp automatically change the"@ "symbol into a relative path to reference?

such as import a from"@ / utils/index"
automatically becomes import a from".. / utils/index"?


first of all, there are some deviations in the author's understanding of gulp and webpack.

  • gulp is a task runner, that can define multiple tasks in gulpfile.js, and webpack packaging js operations can be defined in gulpfile.js as a task. Gulp itself does not handle references and escapes of js.
  • webpack is a tool for packaging front-end resources, such as js,css, images, and so on. There are many scenarios combined with npm scripts.

therefore, the title owner should first confirm which tool is used in gulpfile for js escape and packaging, and then find out whether the corresponding tool provides alias-like configuration items. For example, babel implements the alias of a module with babel-plugin-module-resolver .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31502-3414e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31502-3414e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?