Skip to content

daydayuphuan/gulp-pack-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gulp-pack-tool

打包编译 配置文件

exports.mods = {
    less: {
        src: './src/mobile/less/main.less',
        dest: './src/console/less/css',
        beforeclean: './src/mobile/less/css'
    },
    scss: {
        src: './src/mobile/scss/m.scss',
        dest: './src/mobile/css/scss',
        beforeclean: './src/mobile/css/scss'
    },
    css: {
        src: './src/mobile/css/**/*.css',
        dest: './dist/mobile/css',
        pub: './pub/mobile/css',
        manifest: './pub/mobile',
        beforeclean: true,
        autoprefixer: false
    },
    js: {
        src: ['./src/mobile/scripts/**/*.js', '!./src/mobile/scripts/**/*.min.js'],
        dest: './dist/mobile/scripts',
        pub: './pub/mobile/scripts',
        manifest: './pub/mobile',
        beforeclean: true,
        concat: true,
        amdconfig: {
            baseUrl: './src/mobile/scripts',
            mainConfigFile: './src/mobile/scripts/main.js',
            exclude: ['zepto', 'angular', 'uiRoute', 'ngTouch', 'moment', 'swipe']
        }
    },
    image: {
        src: './src/mobile/imgs/**/*.{png,jpg,jpeg,gif,ico,svg}',
        dest: './dist/mobile/imgs',
        pub: './pub/mobile/imgs',
        compact: true
    },
    html: {
        src: './src/mobile/**/*.html',
        dest: './dist/mobile/',
        pub: './pub/mobile/',
        manifest: './pub',
        minify: true,
        rjs: {
            main: 'main.js'         // requirejs 的主文件
        }
    }
};

打包编译所有类型文件

  1. 编译压缩模式。
gulp pack 
  1. 发布模式命令行后面加 -p
gulp pack -p

打包编译单类文件,同样可在每个命令行后面添加 -p,使用

  1. 编译SCSS
gulp pack_scss
  1. 编译LESS
gulp pack_less
  1. 编译LESS
gulp pack_less
  1. 压缩CSS
gulp pack_less
  1. 图片压缩
gulp pack_image
  1. HTML压缩
gulp pack_html

About

gulp pack tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published