rollup does not like the migrations.js for durable object.

So i had this issue months and months ago. so maybe we have a solution for this now? i think drizzles issues on github are still kind of ignore until v1. so basically the sql import breaks rollup with a nice (migrations.js)
RollupError: Parse failure: Expected ';', '}' or <eof>
At file: /drizzle/0000_daffy_typhoid_mary.sql:1:7
RollupError: Parse failure: Expected ';', '}' or <eof>
At file: /drizzle/0000_daffy_typhoid_mary.sql:1:7
so you either edit the file and give it that .sql?raw or you have a lil hack in your vite config like
{
name: 'sql-as-raw',
transform(code, id) {
if (id.endsWith('.sql')) {
// Return the content as a JavaScript string export
return `export default ${JSON.stringify(code)};`;
}
},
},
{
name: 'sql-as-raw',
transform(code, id) {
if (id.endsWith('.sql')) {
// Return the content as a JavaScript string export
return `export default ${JSON.stringify(code)};`;
}
},
},
and assetsInclude: ['**/
.sql'],
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?