-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:WeBankFinTech/TractionWidget into…
… branch_joy
- Loading branch information
Showing
6 changed files
with
86 additions
and
16 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,10 @@ | ||
import './HorizontalLayout/style'; | ||
import './NavBar/style'; | ||
import './NavHeader/style'; | ||
import './PageLoading/style'; | ||
import './Search/style'; | ||
import './TableHeaderConfig/style'; | ||
import './TablePage/style'; | ||
import './TagSelector/style'; | ||
import './VerticalLayout/style'; | ||
import './TagsPanel/style'; |
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,37 @@ | ||
const path = require('path'); | ||
const fse = require('fs-extra'); | ||
const csso = require('csso'); | ||
const { compilerCss } = require('./compilerCss.js'); | ||
const { OUTPUT_DIR } = require('./build-shard'); | ||
|
||
function getProjectRootDir () { | ||
return process.cwd(); | ||
} | ||
const rootDir = getProjectRootDir(); | ||
const STYLE_SOURCE = path.join(rootDir, './packages/traction-widget/components/_style.ts'); | ||
|
||
fse.mkdirsSync(OUTPUT_DIR); | ||
|
||
async function main () { | ||
const tempFilePath = path.join(OUTPUT_DIR, 'temp.css'); | ||
await compilerCss(STYLE_SOURCE, tempFilePath); | ||
|
||
let cssContent = fse.readFileSync(tempFilePath, 'utf-8'); | ||
|
||
// 替换路径 | ||
cssContent = cssContent.replace(/(\.\.\/\.\.\/assets\/)/g, './assets/'); | ||
|
||
fse.outputFileSync(tempFilePath, cssContent); | ||
|
||
const outputFilePath = path.join(OUTPUT_DIR, 'traction-widget.css'); | ||
fse.moveSync(tempFilePath, outputFilePath, { overwrite: true }); | ||
|
||
const compressResult = csso.minify(cssContent); | ||
|
||
fse.outputFileSync( | ||
path.join(OUTPUT_DIR, 'traction-widget.min.css'), | ||
compressResult.css | ||
); | ||
} | ||
|
||
main(); |