Skip to content

Commit 0636f6a

Browse files
committed
feat: add styles on demand
1 parent 76a5e45 commit 0636f6a

File tree

3 files changed

+53
-41
lines changed

3 files changed

+53
-41
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ npm-debug.log
77
debug.log
88
yarn-error.log
99
package-lock.json
10-
dist/
10+
dist/
11+
gulpfile.js

gulpfile.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const {src, dest,series} = require('gulp');
2+
const through = require('through2');
3+
const sass=require('gulp-sass');
4+
function outputStyleTask () {
5+
return src(['src/components/**/*.scss'])
6+
.pipe(through.obj(function (file, _, callback) {
7+
const pathName=file.relative.split('/')[0]
8+
this.push(pathName)
9+
callback()
10+
}))
11+
.on('data', (data) => {
12+
convertStyles(data)
13+
})
14+
}
15+
function convertStyles(data){
16+
console.log('src/components/'+String(data)+'/*.scss')
17+
return src(['src/components/'+String(data)+'/*.scss'])
18+
.pipe(dest('lib/'+String(data)+'/style/'))
19+
.pipe(sass())
20+
.pipe(dest('lib/'+String(data)+'/style/'))
21+
}
22+
exports.default = outputStyleTask

tsconfig.json

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,30 @@
11
{
2-
"compilerOptions": {
3-
"noEmit": true, // Don't emit; allow Babel to transform files.
4-
"outDir": "./dist/",
5-
"baseUrl": ".",
6-
"experimentalDecorators": true,
7-
"noImplicitAny": false,
8-
"esModuleInterop": true,
9-
"allowJs": true,
10-
"module": "commonjs",
11-
"target": "es5",
12-
"lib": [
13-
"es6",
14-
"es2016",
15-
"dom"
16-
],
17-
"jsx": "react",
18-
"allowSyntheticDefaultImports": true,
19-
"noUnusedLocals": false,
20-
"importHelpers": true,
21-
"paths": {},
22-
"skipLibCheck": true,
23-
"typeRoots": [
24-
"node",
25-
"node_modules/@types",
26-
"./typings"
27-
],
28-
},
29-
"exclude": [
30-
"node_modules",
31-
"dist",
32-
"lib",
33-
"storybook-static",
34-
"src/public/**/*"
35-
],
36-
"include": [
37-
"./**/*.ts",
38-
"./**/*.tsx",
39-
"src/**/*"
40-
]
41-
}
2+
"compilerOptions": {
3+
"noEmit": true, // Don't emit; allow Babel to transform files.
4+
"outDir": "./dist/",
5+
"baseUrl": ".",
6+
"experimentalDecorators": true,
7+
"noImplicitAny": false,
8+
"esModuleInterop": true,
9+
"allowJs": true,
10+
"module": "commonjs",
11+
"target": "es5",
12+
"lib": ["es6", "es2016", "dom"],
13+
"jsx": "react",
14+
"allowSyntheticDefaultImports": true,
15+
"noUnusedLocals": false,
16+
"importHelpers": true,
17+
"paths": {},
18+
"skipLibCheck": true,
19+
"typeRoots": ["node", "node_modules/@types", "./typings"]
20+
},
21+
"exclude": [
22+
"node_modules",
23+
"dist",
24+
"lib",
25+
"storybook-static",
26+
"src/public/**/*",
27+
"./gulpfile.js"
28+
],
29+
"include": ["./**/*.ts", "./**/*.tsx", "src/**/*", "gulpfile.js"]
30+
}

0 commit comments

Comments
 (0)