forked from feathr-ai/feathr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Feature less module in UI code and import alias (feathr-ai#768)
* Add craco devDependencies Signed-off-by: Boli Guan <[email protected]> * Add classnames, @ant-design/icons,eslint-plugin.. dependencies. Signed-off-by: Boli Guan <[email protected]> * Update .editorconfig and .eslintrc * Update .editorconfig Signed-off-by: Boli Guan <[email protected]> Signed-off-by: Boli Guan <[email protected]>
- Loading branch information
Showing
12 changed files
with
1,474 additions
and
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset=utf-8 | ||
end_of_line=lf | ||
insert_final_newline=false | ||
indent_style=space | ||
indent_size=2 | ||
|
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,51 @@ | ||
const path = require("path"); | ||
|
||
const { loaderByName } = require("@craco/craco"); | ||
const CracoLessPlugin = require("craco-less"); | ||
|
||
const resolve = (dir) => path.resolve(__dirname, dir); | ||
|
||
module.exports = { | ||
babel: { | ||
plugins: [ | ||
[ | ||
"import", | ||
{ | ||
libraryName: "antd", | ||
libraryDirectory: "es", | ||
style: true, | ||
}, | ||
], | ||
], | ||
}, | ||
webpack: { | ||
alias: { | ||
"@": resolve("src"), | ||
}, | ||
}, | ||
plugins: [ | ||
{ | ||
plugin: CracoLessPlugin, | ||
options: { | ||
lessLoaderOptions: { | ||
lessOptions: { | ||
modifyVars: {}, | ||
javascriptEnabled: true, | ||
}, | ||
}, | ||
modifyLessModuleRule(lessModuleRule, context) { | ||
// Configure the file suffix | ||
lessModuleRule.test = /\.module\.less$/; | ||
|
||
// Configure the generated local ident name. | ||
const cssLoader = lessModuleRule.use.find(loaderByName("css-loader")); | ||
cssLoader.options.modules = { | ||
localIdentName: "[local]_[hash:base64:5]", | ||
}; | ||
|
||
return lessModuleRule; | ||
}, | ||
}, | ||
}, | ||
], | ||
}; |
Oops, something went wrong.