transform-es
对 ts, es6, scss, less, css 进行转换,并输出到指定目录
Last updated 4 days ago by bplok20010 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install transform-es 
SYNC missed versions from official npm registry.

transform-es

对 ts, es6, scss, less, css 进行转换,并输出到指定目录

install & usage

npm install --save-dev transform-es

npx transform-es init

npx transform-es src

cli

transform-es src -d lib -t esm -c -w

transform-es src -d lib -t web -c -w [-m]

transform-es src -d lib -t node -c -w

  • -f, --outFile 输出到文件,只有单文件转换有效
  • -d, --outDir 输出到指定目录,默认为 lib
  • -c, --clean 转换前清空输出目录
  • -w, --watch 是否监控文件改变
  • -t, --target 指定输出目标: node|web|esm|cjs|commonjs|amd|umd|systemjs|auto 默认web
  • --config 配置文件 默认: transform-es.config.js
  • --state 传递给 transform-es.config.js 的数据

transform-es.config.js

module.exports = function(options, state) {
	return {
		babel: {
			//...babel options
			decoratorsBeforeExport: true,
			strictMode: true,
			useFlow: true,
			loose: true,
			runtimeOptions: {},
			presets: [],
			plugins: [],
		},
		eslint: {},
		postcss: {},
		//compilerOptions
		typescript: {},
	};
};

api

transformEs( src, dest, options );

options

 {
        glob: ["**/*", "**/*.*", "**/.*"],
        clean: true, //转换前清空输出目录
        watch: false,
        ignore: null, // file => boolean
        filter: null,// file => boolean
        babel: {
            decoratorsBeforeExport: true,
            strictMode: true,
            useFlow: true,
            loose: true,
            runtimeOptions: {},
            presets: [],
            plugins: [],
            ...presetOptions
        },
        eslint: {},
        postcss: {},
    }

examples

const transformEs = require('transform-es');

transformEs('src', 'lib', {
    watch: true
});

Current Tags

  • 4.0.0-beta4                                ...           beta (6 months ago)
  • 5.0.4                                ...           latest (4 days ago)
  • 3.3.5-next                                ...           next (7 months ago)

90 Versions

  • 5.0.4                                ...           4 days ago
  • 5.0.3                                ...           2 months ago
  • 5.0.2                                ...           2 months ago
  • 5.0.1                                ...           2 months ago
  • 5.0.0                                ...           3 months ago
  • 4.6.6                                ...           4 months ago
  • 4.6.5                                ...           5 months ago
  • 4.6.4                                ...           6 months ago
  • 4.6.3                                ...           6 months ago
  • 4.6.2                                ...           6 months ago
  • 4.6.1                                ...           6 months ago
  • 4.6.0                                ...           6 months ago
  • 4.5.5                                ...           6 months ago
  • 4.5.4                                ...           6 months ago
  • 4.5.3                                ...           6 months ago
  • 4.5.2                                ...           6 months ago
  • 4.5.1                                ...           6 months ago
  • 4.5.0                                ...           6 months ago
  • 4.4.0                                ...           6 months ago
  • 4.3.1                                ...           6 months ago
  • 4.3.0                                ...           6 months ago
  • 4.2.0                                ...           6 months ago
  • 4.1.0                                ...           6 months ago
  • 4.0.4                                ...           6 months ago
  • 4.0.3                                ...           6 months ago
  • 4.0.2                                ...           6 months ago
  • 4.0.1                                ...           6 months ago
  • 4.0.0                                ...           6 months ago
  • 4.0.0-beta4                                ...           6 months ago
  • 4.0.0-beta3                                ...           6 months ago
  • 4.0.0-beta2                                ...           6 months ago
  • 4.0.0-beta1                                ...           6 months ago
  • 3.3.3                                ...           6 months ago
  • 3.3.2                                ...           7 months ago
  • 3.3.1                                ...           7 months ago
  • 3.3.0                                ...           7 months ago
  • 3.3.5-next                                ...           7 months ago
  • 3.3.4-next                                ...           7 months ago
  • 3.3.3-next                                ...           7 months ago
  • 3.3.2-next                                ...           7 months ago
  • 3.3.1-next                                ...           7 months ago
  • 3.3.0-next                                ...           7 months ago
  • 3.2.1                                ...           8 months ago
  • 3.2.0                                ...           10 months ago
  • 3.1.1                                ...           10 months ago
  • 3.1.0                                ...           10 months ago
  • 3.0.11-beta1                                ...           10 months ago
  • 3.0.10-beta1                                ...           10 months ago
  • 3.0.9-beta1                                ...           10 months ago
  • 3.0.8-beta1                                ...           10 months ago
  • 3.0.7-beta1                                ...           10 months ago
  • 3.0.6-beta1                                ...           10 months ago
  • 3.0.5-beta1                                ...           10 months ago
  • 3.0.4-beta1                                ...           10 months ago
  • 3.0.3-beta1                                ...           10 months ago
  • 3.0.2-beta1                                ...           10 months ago
  • 3.0.1-beta1                                ...           10 months ago
  • 3.0.0-beta1                                ...           10 months ago
  • 2.3.0                                ...           a year ago
  • 2.2.10                                ...           2 years ago
  • 2.2.9                                ...           2 years ago
  • 2.2.8                                ...           2 years ago
  • 2.2.7                                ...           2 years ago
  • 2.2.7-next.4                                ...           2 years ago
  • 2.2.7-next.3                                ...           2 years ago
  • 2.2.7-next.2                                ...           2 years ago
  • 2.2.7-next.1                                ...           2 years ago
  • 2.2.6-next.3                                ...           2 years ago
  • 2.2.6-next.2                                ...           2 years ago
  • 2.2.6                                ...           2 years ago
  • 2.2.5-next.1                                ...           2 years ago
  • 2.2.5                                ...           2 years ago
  • 2.2.4-beta.2                                ...           2 years ago
  • 2.2.4-beta.1                                ...           2 years ago
  • 2.2.4                                ...           2 years ago
  • 2.2.3                                ...           2 years ago
  • 2.2.2                                ...           2 years ago
  • 2.2.1                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.5.1                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.1                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 14
This Month 14
Last Day 0
Last Week 1
Last Month 2
Dependencies (26)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |