Open frederikhors opened 4 years ago
Edit: Added reproduction project.
I have no real idea how sourcemaps works in Nollup (or generally otherwise...), but you can probably fix this by adding a middleware to serve contents from /node_modules/
if that's important to you.
Add a .nolluprc.js
file to your project with something like this:
const path = require('path')
const fs = require('fs')
module.exports = {
before(app) {
app.get('/node_modules/*', (req, res, next) => {
const file = path.resolve(__dirname, req.url.replace(/^\//, ''))
fs.exists(file, exists => {
if (exists)res.sendFile(file)
else next()
})
})
}
}
Wow it works!
But I have totally no idea what I'm doing.
Does it impact performance in your opinion?
Can it affect the final bundle created with npm run build
?
I was surely tired previously, it's obviously not a sourcemap problem. It's a more of a dev server problem.
No it wouldn't impact performance in any meaningful way... Like we're speaking less than a ms or so per request. And it wouldn't end up in prod build. Nollup doesn't do prod build. It doesn't do build at all actually. It just does fast dev server mostly compatible with Rollup config. It is intended that you produce your prod bundle with Rollup.
I'm trying to use the amazing @urql/svelte.
It works both with nollup and rollup.
But with nollup I have these warnings in console:
Reproduction here: https://github.com/frederikhors/svelte-template-hot/tree/urql-svelte-sourcemap-warnings
Why?