Sha256: 7fcf497d5740aeb32d7903b1262f0cdd58e835123563ce975a55365c74a77dbf

Contents?: true

Size: 835 Bytes

Versions: 15

Compression:

Stored size: 835 Bytes

Contents

const { resolve } = require('path')
const { realpathSync } = require('fs')
const { loaderMatches } = require('../utils/helpers')

const {
  source_path: sourcePath,
  additional_paths: additionalPaths,
  webpack_loader: webpackLoader
} = require('../config')
const { isProduction } = require('../env')

module.exports = loaderMatches(webpackLoader, 'babel', () => ({
    test: /\.(js|jsx|mjs|ts|tsx|coffee)?(\.erb)?$/,
    include: [sourcePath, ...additionalPaths].map((p) => {
      try {
        return realpathSync(p)
      } catch (e) {
        return resolve(p)
      }
    }),
    exclude: /node_modules/,
    use: [
      {
        loader: require.resolve('babel-loader'),
        options: {
          cacheDirectory: true,
          cacheCompression: isProduction,
          compact: isProduction
        }
      }
    ]
  }))

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
shakapacker-6.5.5 package/rules/babel.js
shakapacker-6.5.4 package/rules/babel.js
shakapacker-6.5.3 package/rules/babel.js
shakapacker-6.5.2 package/rules/babel.js
shakapacker-6.5.1 package/rules/babel.js
shakapacker-6.5.0 package/rules/babel.js
shakapacker-6.4.1 package/rules/babel.js
shakapacker-6.4.0 package/rules/babel.js
shakapacker-6.3.0 package/rules/babel.js
shakapacker-6.3.0.pre.rc.1 package/rules/babel.js
shakapacker-6.2.1 package/rules/babel.js
shakapacker-6.2.0 package/rules/babel.js
shakapacker-6.1.1 package/rules/babel.js
shakapacker-6.1.0 package/rules/babel.js
shakapacker-6.1.0.beta.0 package/rules/babel.js