1. Create: Gulpfile.js
//Introducing PluginsvarGulp = require (' Gulp '));varAutoprefixer = require (' gulp-autoprefixer ')); //Default Execution TasksGulp.task (' Default ',function () { //Locate the SRC directory under app.css for its full browser-compatible CSS returnGULP.SRC (' Src/app.css '). Pipe (Autoprefixer ({browsers: [' Last 2 versions '], Cascade:false })) //Output to Dist folder. Pipe (Gulp.dest (' Dist '));});
2. Create Package.json
NPM Init
3. Install Gulp to Project
NPM Install--save-dev Gulp
4. Install the plugin to the project:
NPM Install--save-dev Gulp-autoprefixer
5. Src/app.css of preparation
. Container { display: flex;}
6. Run the directory:
Gulp
Then check that Dist/app.css has been added with the compatible suffix
. Container { display: -webkit-flex; display: -ms-flexbox; display: flex;}
Use of Gulp plug-in Autoprefixer