Using Gulp, is it possible to add environment variables as a comment into CSS? (for example the package.json version)
问题 Is it possible to pipe through specific environment variables in an SCSS file using a gulp setup? Could you, for example, use something like: /*! %version% */ Where version would be the version number as used in package.json. 回答1: From gulp-header example: // using data from package.json var pkg = require('./package.json'); //var banner = ['/**', // ' * <%= pkg.name %> - <%= pkg.description %>', // ' * @version v<%= pkg.version %>', // ' * @link <%= pkg.homepage %>', // ' * @license <%= pkg