File tree Expand file tree Collapse file tree 3 files changed +28
-15
lines changed
Expand file tree Collapse file tree 3 files changed +28
-15
lines changed Original file line number Diff line number Diff line change 77 " !{projectRoot}/**/*.{md,mdx}" ,
88 " {projectRoot}/tsconfig.json" ,
99 " {projectRoot}/package.json" ,
10+ " {projectRoot}/rslib.config.*" ,
1011 " {projectRoot}/modern.config.*" ,
1112 " {projectRoot}/scripts/**/*"
1213 ],
Original file line number Diff line number Diff line change 1- import path from 'node:path' ;
2- import { pureEsmPackage } from '@rsbuild/config/rslib.config.ts' ;
1+ import {
2+ cjsConfig ,
3+ dualPackage ,
4+ esmConfig ,
5+ } from '@rsbuild/config/rslib.config.ts' ;
36import { defineConfig } from '@rslib/core' ;
47
58export default defineConfig ( {
6- ...pureEsmPackage ,
7- output : {
8- ...pureEsmPackage . output ,
9- copy : [
10- {
11- from : path . resolve ( __dirname , 'src/index.cjs' ) ,
9+ ...dualPackage ,
10+ lib : [
11+ esmConfig ,
12+ {
13+ ...cjsConfig ,
14+ output : {
15+ target : 'node' ,
16+ // TODO https://github.com/web-infra-dev/rslib/issues/287
17+ externals : {
18+ webpack : 'import webpack' ,
19+ 'copy-webpack-plugin' : 'import copy-webpack-plugin' ,
20+ 'mini-css-extract-plugin' : 'import mini-css-extract-plugin' ,
21+ 'tsconfig-paths-webpack-plugin' :
22+ 'import tsconfig-paths-webpack-plugin' ,
23+ } ,
1224 } ,
13- ] ,
14- } ,
25+ footer : {
26+ // TODO https://github.com/web-infra-dev/rslib/issues/351
27+ js : `// Annotate the CommonJS export names for ESM import in node:
28+ 0 && (module.exports = { webpackProvider: exports.webpackProvider });` ,
29+ } ,
30+ } ,
31+ ] ,
1532} ) ;
Original file line number Diff line number Diff line change @@ -27,8 +27,3 @@ export const dualPackage = defineConfig({
2727 } ,
2828 } ,
2929} ) ;
30-
31- export const pureEsmPackage = defineConfig ( {
32- ...dualPackage ,
33- lib : [ esmConfig ] ,
34- } ) ;
You can’t perform that action at this time.
0 commit comments