File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
packages/core/src/plugins Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ export const pluginEsm = (): RsbuildPlugin => ({
1616 chain . optimization . runtimeChunk ( true ) ;
1717 }
1818
19+ if ( target === 'node' ) {
20+ chain . output . library ( {
21+ ...chain . output . get ( 'library' ) ,
22+ type : 'module' ,
23+ } ) ;
24+ }
25+
1926 if ( target === 'web-worker' ) {
2027 throw new Error (
2128 '[rsbuild:config] `output.module` is not supported for web-worker target.' ,
@@ -26,11 +33,7 @@ export const pluginEsm = (): RsbuildPlugin => ({
2633 . module ( true )
2734 . chunkFormat ( 'module' )
2835 . chunkLoading ( 'import' )
29- . workerChunkLoading ( 'import' )
30- . library ( {
31- ...chain . output . get ( 'library' ) ,
32- type : 'module' ,
33- } ) ;
36+ . workerChunkLoading ( 'import' ) ;
3437
3538 chain . experiments ( {
3639 ...chain . get ( 'experiments' ) ,
You can’t perform that action at this time.
0 commit comments