Skip to content

Commit

Permalink
feat: create step to generate sourcemaps (#290)
Browse files Browse the repository at this point in the history
* feat: create step to generate sourcemaps

* chore: adjust postcss version
  • Loading branch information
lpeil authored May 31, 2024
1 parent 4eec5c0 commit 72f3f35
Show file tree
Hide file tree
Showing 3 changed files with 1,043 additions and 425 deletions.
25 changes: 23 additions & 2 deletions build/web/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const typescript = require('gulp-typescript');
const $ = require('gulp-load-plugins')();

gulp.task('build:web:scss', () =>
Expand All @@ -15,15 +17,34 @@ gulp.task('build:web:scss', () =>

gulp.task('build:web:js', () =>
gulp
.src('src/tokens.yml')
.src('src/tokens.yml', { sourcemaps: true })
.pipe(
$.theo({
transform: { type: 'web' },
format: { type: 'module.js' },
})
)
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe($.rename('tokens.js'))
.pipe(gulp.dest('dist/web'))
);

exports.build = gulp.parallel('build:web:scss', 'build:web:js');
gulp.task('build:web:ts', () =>
gulp
.src('dist/web/tokens.js')
.pipe(
typescript({
noImplicitAny: true,
removeComments: true,
preserveConstEnums: true,
module: 'system',
declaration: true,
allowJs: true,
})
)
.pipe(gulp.dest('dist/web'))
);

gulp.task('build:web', gulp.parallel('build:web:scss', 'build:web:js'));

exports.build = gulp.series('build:web', 'build:web:ts');
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"gulp": "^4.0.2",
"gulp-dom": "^1.0.0",
"gulp-load-plugins": "^2.0.7",
"gulp-sourcemaps": "^3.0.0",
"gulp-typescript": "^5.0.1",
"immutable": "^4.0.0",
"lodash": "^4.17.21",
"theo": "^8.1.5",
Expand Down Expand Up @@ -58,6 +60,7 @@
"gulp-util": "^3.0.8",
"husky": "^7.0.0",
"is-ci": "^3.0.0",
"postcss": "8.4.31",
"prettier": "^2.5.0",
"pretty-quick": "^3.1.2",
"semantic-release": "^19.0.0"
Expand Down
Loading

0 comments on commit 72f3f35

Please sign in to comment.