Skip to content

Commit

Permalink
fix(stylus-modules): fix 'module' has already been declared issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 28, 2023
1 parent f739e21 commit 64fc8af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/stylus-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"src"
],
"scripts": {
"build": "tsbb build --no-esm",
"watch": "tsbb watch --no-esm"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/stylus-modules/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export type StylusLoaderOptions = LoaderConfOptions &
) => string;
};

const createLessModule = (stylusLoaderOptions = {} as StylusLoaderOptions) => {
const createStylusModule = (stylusLoaderOptions = {} as StylusLoaderOptions) => {
return function (conf: Configuration, evn: string, options = {} as ParsedArgs) {
if (!conf) {
throw Error('KKT:ConfigPaths: there is no config file found');
Expand Down Expand Up @@ -171,7 +171,7 @@ const createLessModule = (stylusLoaderOptions = {} as StylusLoaderOptions) => {
/**
* Use create-react-app to build react libraries. Support for regular less files and *.module.less files.
*/
const module = createLessModule();
(module as any).withLoaderOptions = createLessModule;
const stylusModule = createStylusModule();
(stylusModule as any).withLoaderOptions = createStylusModule;

export default module;
export default stylusModule;

0 comments on commit 64fc8af

Please sign in to comment.