Skip to content

Commit

Permalink
build: add svg to React component workflow (#15)
Browse files Browse the repository at this point in the history
* build: add svg to React component workflow

* fix: fix the problem of viewBox being removed
  • Loading branch information
simonguo authored Oct 28, 2024
1 parent b9e5747 commit ceb2e05
Show file tree
Hide file tree
Showing 1,995 changed files with 17,217 additions and 5,430 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ $ npm run build
```bash
$ npm run test
```

9 changes: 8 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const sourcemaps = require('gulp-sourcemaps');
const rename = require('gulp-rename');
const gulp = require('gulp');
const swc = require('gulp-swc');
const svgToReact = require('./scripts/svgToReact');
const generateIconComponents = require('./scripts/generateIconComponents');
const proxyDirectories = require('./scripts/proxyDirectories');

const lessDir = './src/less';
const tsSrcFiles = ['./src/**/*.tsx', './src/**/*.ts', '!./src/**/*.d.ts'];
const libRoot = path.join(__dirname, './lib');
Expand All @@ -20,7 +22,7 @@ const esmRoot = path.join(libRoot, 'esm');
const cjsRoot = path.join(libRoot, 'cjs');
const cssRoot = path.join(libRoot, 'dist/css');

const ICON_COMPONENT_DIR = './src/icons';
const ICON_COMPONENT_DIR = './src/react';

const writeFile = util.promisify(fs.writeFile);

Expand Down Expand Up @@ -107,6 +109,11 @@ function createPkgFile(done) {
});
}

exports.svgToReact = cb => {
svgToReact();
cb();
};

exports.buildIconComponent = gulp.series(buildIconComponent);
exports.build = gulp.series(
clean,
Expand Down
Loading

0 comments on commit ceb2e05

Please sign in to comment.