Skip to content

Commit

Permalink
build: add esm build
Browse files Browse the repository at this point in the history
  • Loading branch information
wendellhu committed Jul 20, 2020
1 parent 17fa5ec commit 06be6fb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -30,3 +30,4 @@ yarn.lock
package-lock.json
/.history
lib
es
34 changes: 27 additions & 7 deletions gulpfile.js
Expand Up @@ -2,11 +2,31 @@ const gulp = require('gulp');
const ts = require('gulp-typescript');
const tsconfig = require('./tsconfig.json');

gulp.task('default', () => gulp
.src('src/**/*.ts')
.pipe(ts({
...tsconfig.compilerOptions,
declaration: true,
}))
.pipe(gulp.dest('lib'))
gulp.task('lib', () =>
gulp
.src('src/**/*.ts')
.pipe(
ts({
...tsconfig.compilerOptions,
declaration: true,
}),
)
.pipe(gulp.dest('lib')),
);

gulp.task('es', () =>
gulp
.src('src/**/*.ts')
.pipe(
ts({
...tsconfig.compilerOptions,
target: 'es2015',
module: 'esnext',
declaration: true,
moduleResolution: 'node',
}),
)
.pipe(gulp.dest('es')),
);

gulp.task('default', gulp.parallel('lib', 'es'));
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"version": "4.0.1",
"description": "Color palettes calculator of Ant Design",
"main": "lib/index.js",
"module": "lib/index.js",
"module": "es/index.js",
"files": [
"lib"
],
Expand Down

0 comments on commit 06be6fb

Please sign in to comment.