Sha256: 7654901b8c58b314141a69302ecfb3cb896be90c1daa25aa4f927ba603c14155

Contents?: true

Size: 567 Bytes

Versions: 3

Compression:

Stored size: 567 Bytes

Contents

const { dirname, join } = require('path')
const { source_path: sourcePath } = require('../config')

module.exports = {
  test: /\.(bmp|gif|jpe?g|png|tiff|ico|avif|webp|eot|otf|ttf|woff|woff2|svg)$/,
  exclude: /\.(js|mjs|jsx|ts|tsx)$/,
  type: 'asset/resource',
  generator: {
    filename: (pathData) => {
      const folders = dirname(pathData.filename)
        .replace(`${sourcePath}/`, '')
        .split('/')
        .slice(1)

      const foldersWithStatic = join('static', ...folders)
      return `${foldersWithStatic}/[name]-[hash][ext][query]`
    }
  }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shakapacker-6.3.0.pre.rc.1 package/rules/file.js
shakapacker-6.2.1 package/rules/file.js
shakapacker-6.2.0 package/rules/file.js