balena-supervisor/build-utils/hardcode-migrations.js
Cameron Diver 02d088d351 Move build files into build-conf and rename to build-utils
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2020-05-05 17:55:28 +01:00

12 lines
353 B
JavaScript

// knex migrations use dynamic requires which break with webpack.
// This hack makes the migrations directory a constant so that at least we can use webpack contexts for the
// require.
module.exports = function(source) {
return source
.toString()
.replace(
'path.join(absoluteDir, migration.file)',
`'./migrations/'+migration.file`,
);
};