Upload the sourcemap files after your project is packaged
yarn add --dev upload-my-sourcemap-plugin
// webpack.prod.config.js
const UploadSourceMapPlugin = require('upload-my-sourcemap-plugin')
module.exports = merge(baseConfig, {
//..
plugins: [
...baseConfig.plugins,
new UploadSourceMapPlugin({
targetUrl: 'https://xxx/api/upload', // upload api url
buildPath: path.join(process.cwd(), 'dist') // The folder path of the packaged product
})
]
})