2017-11-29 21:32:57 +00:00
|
|
|
// 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.
|
2020-05-15 11:01:51 +00:00
|
|
|
module.exports = function (source) {
|
2022-09-27 17:43:27 +00:00
|
|
|
return (
|
|
|
|
source
|
|
|
|
.toString()
|
|
|
|
// IMPORTANT: this is known to work with knex v0.95.15. It will most likely break
|
|
|
|
// if knex is upgraded. This is really a hack and should be replaced by a more sustainable
|
|
|
|
// webpack configuration.
|
|
|
|
.replace('importFile(_path)', "require('./migrations/'+migration.file)")
|
|
|
|
);
|
2020-04-27 17:33:41 +00:00
|
|
|
};
|