Билд приложение не в одну строку | Rollup | JS
Можно ли как-то сгенерировать билд-файл не в одну строку в rollup? Получается так, что теперь все ошибки и вывод console.trace указывают на esm файл, которой идет в одну строку, поэтому никак нормально не отладить баги и ошибки. Можно как-то избежать этого? Или есть ли у кого-то идеи, как вывести трассировку другими способами?
Конфиг:
export default {
input: 'src/index.ts',
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true
}
],
external: ['react', 'react-dom', 'prop-types'].concat(/@babel\/runtime/),
plugins: [
json(),
peerDepsExternal(),
typescript({ noEmitOnError: true, tsconfig: './tsconfig.json' }), //{ useTsconfigDeclarationDir: true }
image({ exclude: '**/*.svg' }),
babel({
babelHelpers: 'runtime',
exclude: ['node_modules/**', 'init/**']
}),
postcss({
extract: true,
plugins: [autoprefixer]
// minimize: true
}),
resolve({
browser: true,
extensions: ['.ts', '.tsx'],
resolveOnly: [
/^(?!react$)/,
/^(?!react-dom$)/,
/^(?!prop-types)/,
/^(?!classnames)/
]
}),
commonjs(),
//svgr(),
copy({
targets: [
{
src: 'assets',
dest: 'build'
}
]
}),
terser(),
filesize()
]
}