2021-10-02 16:01:17 +00:00
|
|
|
// CommonJS proxy to bypass jiti transforms from nuxt 2
|
|
|
|
module.exports = function (...args) {
|
|
|
|
return import('./dist/module.mjs').then(m => m.default.call(this, ...args))
|
|
|
|
}
|
2021-10-06 12:31:52 +00:00
|
|
|
|
2021-12-21 13:57:26 +00:00
|
|
|
const pkg = require('./package.json')
|
|
|
|
|
2021-10-06 12:31:52 +00:00
|
|
|
module.exports.defineNuxtConfig = (config = {}) => {
|
|
|
|
if (config.bridge !== false) {
|
2021-12-21 13:57:26 +00:00
|
|
|
config.bridge = config.bridge || {}
|
|
|
|
config.bridge._version = pkg.version
|
2021-10-06 12:31:52 +00:00
|
|
|
if (!config.buildModules) {
|
|
|
|
config.buildModules = []
|
|
|
|
}
|
2021-10-29 10:13:59 +00:00
|
|
|
if (!config.buildModules.find(m => m === '@nuxt/bridge' || m === '@nuxt/bridge-edge')) {
|
2022-01-05 18:22:13 +00:00
|
|
|
// Ensure other modules register their hooks before
|
|
|
|
config.buildModules.push('@nuxt/bridge')
|
2021-10-06 12:31:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return config
|
|
|
|
}
|
2021-10-07 08:43:00 +00:00
|
|
|
|
|
|
|
module.exports.meta = {
|
|
|
|
pkg,
|
|
|
|
name: pkg.name,
|
|
|
|
version: pkg.version
|
|
|
|
}
|