Sha256: f5191a0d7a372691acca1578db488f34771a2a8cb00beb73beaa11ec9acf3594

Contents?: true

Size: 756 Bytes

Versions: 14

Compression:

Stored size: 756 Bytes

Contents

const fs = require('fs')
const { resolve } = require('path')
const { setShakapackerEnvVariablesForBackwardCompatibility } = require('./helpers')

setShakapackerEnvVariablesForBackwardCompatibility()

// For backward compatibility
const resolveToPhysicalFilePath = () => {
  const shakapackerConfigPath = resolve('config', 'shakapacker.yml')
  const webpackerConfigPath = resolve('config', 'webpacker.yml')

  if (fs.existsSync(shakapackerConfigPath)) return shakapackerConfigPath
  if (fs.existsSync(webpackerConfigPath)) return webpackerConfigPath

  // If neither of files exist, try to resolve to shakapacker.yml to get more relevant error
  return shakapackerConfigPath
}

module.exports = process.env.SHAKAPACKER_CONFIG || resolveToPhysicalFilePath()

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
shakapacker-7.2.3 package/utils/configPath.js
shakapacker-7.3.0.beta.1 package/utils/configPath.js
shakapacker-7.2.2 package/utils/configPath.js
shakapacker-7.2.1 package/utils/configPath.js
shakapacker-7.2.0 package/utils/configPath.js
shakapacker-7.2.0.rc.0 package/utils/configPath.js
shakapacker-7.1.0 package/utils/configPath.js
shakapacker-7.0.3 package/utils/configPath.js
shakapacker-7.0.2 package/utils/configPath.js
shakapacker-7.0.1 package/utils/configPath.js
shakapacker-7.0.0 package/utils/configPath.js
shakapacker-7.0.0.rc.2 package/utils/configPath.js
shakapacker-7.0.0.rc.1 package/utils/configPath.js
shakapacker-7.0.0.rc.0 package/utils/configPath.js