mirror of
https://github.com/zhigang1992/connect.git
synced 2026-03-27 22:49:07 +08:00
feat: better bundle size with esmodules
This commit is contained in:
committed by
Thomas Osmonson
parent
4ef2948fee
commit
2c7046f70d
@@ -91,7 +91,7 @@
|
||||
]
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/ui.esm.js",
|
||||
"module": "dist/index.esm.js",
|
||||
"peerDependencies": {
|
||||
"react": "16.x",
|
||||
"react-dom": "16.x",
|
||||
|
||||
10
packages/ui/tsdx.config.js
Normal file
10
packages/ui/tsdx.config.js
Normal file
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
rollup(config, options) {
|
||||
if (options.format === 'esm') {
|
||||
config = { ...config, preserveModules: true };
|
||||
config.output = { ...config.output, dir: 'dist/', entryFileNames: '[name].esm.js' };
|
||||
delete config.output.file;
|
||||
}
|
||||
return config;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user