-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: plugin type missing when set moduleResolution node16+ (#3089)
- Loading branch information
Showing
36 changed files
with
158 additions
and
107 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,3 +1,3 @@ | ||
import { configForDualPackage } from '@rsbuild/config/modern.config.ts'; | ||
import { configForSeparateTypesPackage } from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default configForDualPackage; | ||
export default configForSeparateTypesPackage; |
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,14 +1,35 @@ | ||
import { moduleTools } from '@modern-js/module-tools'; | ||
import { dualBuildConfigs } from '@rsbuild/config/modern.config.ts'; | ||
import { | ||
cjsBuildConfig, | ||
emitTypePkgJsonPlugin, | ||
esmBuildConfig, | ||
} from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default { | ||
plugins: [moduleTools()], | ||
buildConfig: dualBuildConfigs.map((config) => { | ||
config.externals = [ | ||
...(config.externals || []), | ||
'svelte/compiler', | ||
'svelte-preprocess/dist/types', | ||
]; | ||
return config; | ||
}), | ||
plugins: [moduleTools(), emitTypePkgJsonPlugin], | ||
buildConfig: [ | ||
{ | ||
...esmBuildConfig, | ||
externals: [ | ||
...(esmBuildConfig.externals || []), | ||
'svelte/compiler', | ||
'svelte-preprocess/dist/types', | ||
], | ||
}, | ||
{ | ||
...cjsBuildConfig, | ||
externals: [ | ||
...(cjsBuildConfig.externals || []), | ||
'svelte/compiler', | ||
'svelte-preprocess/dist/types', | ||
], | ||
}, | ||
{ | ||
buildType: 'bundleless', | ||
dts: { | ||
distPath: '../dist-types', | ||
only: true, | ||
}, | ||
}, | ||
], | ||
}; |
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,13 +1,25 @@ | ||
import { moduleTools } from '@modern-js/module-tools'; | ||
import { dualBuildConfigs } from '@rsbuild/config/modern.config.ts'; | ||
import { defineConfig, moduleTools } from '@modern-js/module-tools'; | ||
import { | ||
cjsBuildConfig, | ||
emitTypePkgJsonPlugin, | ||
esmBuildConfig, | ||
} from '@rsbuild/config/modern.config.ts'; | ||
|
||
export default { | ||
plugins: [moduleTools()], | ||
buildConfig: dualBuildConfigs.map((config) => { | ||
if (config.format === 'cjs') { | ||
export default defineConfig({ | ||
plugins: [moduleTools(), emitTypePkgJsonPlugin], | ||
buildConfig: [ | ||
esmBuildConfig, | ||
{ | ||
...cjsBuildConfig, | ||
// add loader to entry | ||
config.input = ['src/index.ts', 'src/loader.ts']; | ||
} | ||
return config; | ||
}), | ||
}; | ||
input: ['src/index.ts', 'src/loader.ts'], | ||
}, | ||
{ | ||
buildType: 'bundleless', | ||
dts: { | ||
distPath: '../dist-types', | ||
only: true, | ||
}, | ||
}, | ||
], | ||
}); |
Oops, something went wrong.