0.0.1 • Published 6 years ago

neverland-build v0.0.1

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
6 years ago

api

参数说明类型默认值
entry需要打包的路径array[]
output输出路径string'./dist'
context运行目录stringprocess.cwd()
sourceMap是否需要开启 sourceMapboolfalse
clean打包前是否需要清空输出目录内的文件boolfalse
aliasaliasbool or objectfalse
dll是否需要开启 sourceMapboolfalse
'use strict';

const options = {
  common: {
    entry: [],
    output: './dist',
    context: process.cwd(),
    sourceMap: false,
    clean: false,
    alias: false,
    dll: false,
    common: false,
    define: false,
    provide: false,
    react: true,
    vue: false,
    'tree-shaking': true,
    babel: {
      test: '/\\.js$/',
      exclude: ['node_modules'],
      include: [],
      options: {
        babelrc: true,
        modules: false,
        cacheDirectory: true,
        stage: true
      }
    },
    style: {
      test: '/\\.s?css$/',
      exclude: [],
      include: [],
      options: {
        extract: true,
        'style-loader': true,
        'css-loader': true,
        'postcss-loader': {
          autoprefixer: true,
          'sass-like': false
        }
      }
    },
    url: {
      test: '/\\.(png|jpg|gif)$/',
      exclude: [],
      include: [],
      options: {
        limit: 50000
      }
    },
    extensions: ['.js', '.json'],
    parallel: false
  },
  dev: {
    browsers: ['Chrome >= 50'],
    hash: false,
    minimize: false,
    watch: true
  },
  prd: {
    hash: true,
    minimize: true,
    browsers: ['Chrome >= 10', 'Safari >= 6', 'Firefox >= 5']
  }
};

module.exports = options;