-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64a3ee1
commit 3d1a458
Showing
16 changed files
with
90 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const sass = require('sass') | ||
const glob = require('glob') | ||
const fsExtra = require('fs-extra') | ||
const fs = require('fs/promises') | ||
const path = require('path') | ||
const shelljs = require('shelljs') | ||
const componentScss = glob.sync('dist/packages/**/*.scss') | ||
|
||
componentScss.map(async (cs) => { | ||
const filename = path.basename(cs).replace('.scss', '') | ||
const dirname = path.dirname(cs) | ||
|
||
if (dirname.indexOf(filename) === -1) return | ||
|
||
const res = await fs.readFile(path.join(process.cwd(), cs)) | ||
fsExtra.outputFileSync( | ||
path.join(process.cwd(), cs + '.1.scss'), | ||
`@import "../../styles/variables";\n` + res.toString() | ||
) | ||
shelljs.exec( | ||
`sass dist/packages/${filename}/${filename}.scss.1.scss dist/packages/${filename}/${filename}.css` | ||
) | ||
fsExtra.removeSync(path.join(process.cwd(), `dist/packages/${filename}/${filename}.scss.1.scss`)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
const config = require('../src/config.json') | ||
const path = require('path') | ||
const fs = require('fs-extra') | ||
let importScssStr = `\n` | ||
config.nav.map((item) => { | ||
item.packages.forEach((element) => { | ||
let { name, show, exportEmpty } = element | ||
const nameLowerCase = name.toLowerCase() | ||
const file = path.resolve(process.cwd(), `dist/esm/${name}/style/index.js`) | ||
const cssFile = path.resolve(process.cwd(), `dist/esm/${name}/style/css.js`) | ||
if (show || exportEmpty) { | ||
importScssStr = `import '../../../packages/${nameLowerCase}/${nameLowerCase}.scss'` | ||
fs.outputFileSync(file, importScssStr) | ||
fs.outputFileSync(file, `require('../../../packages/${nameLowerCase}/${nameLowerCase}.scss')`) | ||
fs.outputFileSync( | ||
cssFile, | ||
`require('../../../packages/${nameLowerCase}/${nameLowerCase}.css')` | ||
) | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import { TabbarItem } from './tabbarItem' | ||
import { TabbarItem } from './tabbaritem' | ||
export default TabbarItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters