enter image description here
How to configure the package.json module?
How to configure the package.json module?
json
output: {
path: path.resolve(__dirname, '../../dist/esm'),
filename: '[name].esm.js ', // 使用动态占位符
filename: (pathData) => {
console.log('pathData', pathData);
const name = pathData.chunk.name || 'default'; // 获取 chunk 名称
if (name === 'app') {
return 'sdk3.esm.js';
}
return `${name}.esm.js`;
},
library: {
type: 'module'
},
},
//dont have name ‘main’/’app’
New contributor
robin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.