0.0.4 • Published 3 years ago
wcx-pages v0.0.4
Gulp Pages
安装教程
yarn add wcx-pages -D
使用说明
...
"scripts": {
...
"clean": "wcx-pages clean",
"dev": "wcx-pages dev",
"build": "wcx-pages build",
"start": "wcx-pages start"
...
},
...
gulp.config.js
配置参数
{
// 源代码
source: 'src',
// 构建输出目标
destination: 'dist',
// 无须编译静态资源
public: 'public',
// browser-sync options
browserSyncNotify: false,
browserSyncOpen: false,
port: 3006,
// sass options
sassOptions: {
outputStyle: 'compressed',
},
// babel options
babelOptions: {
presets: ['@babel/preset-env'],
},
// uglify options
uglifyOptions: {
compress: { drop_console: true }
},
// autoprefixer osptions
autoprefixerOptions: {},
// imagemin options
imageminOptions: {},
// htmlmin options
htmlminOptions: {
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true,
processConditionalComments: true,
removeComments: true,
removeEmptyAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
},
// 相对路径 相对于源代码文件夹
paths: {
styles: 'assets/styles/*.scss',
scripts: 'assets/scripts/*.js',
pages: '*.html',
fonts: 'assets/fonts/**/*.{eot,svg,ttf,woff,woff2}',
images: 'assets/images/**/*.{jpg,jpeg,svg,png,webp}',
},
ignore: {
styles: ['assets/styles/_*.scss'],
scripts: [],
pages: ['{layouts|partials}/*.html'],
fonts: [],
images: [],
},
}