Sha256: 704c8a1d37ede587635ec2e502fdae932b5315abe52853ef862e698ac375548b

Contents?: true

Size: 522 Bytes

Versions: 37

Compression:

Stored size: 522 Bytes

Contents

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

module.exports = {
  test: new RegExp(`(${fileExtensions.join('|')})$`, 'i'),
  use: [
    {
      loader: 'file-loader',
      options: {
        name(file) {
          if (file.includes(sourcePath)) {
            return 'media/[path][name]-[hash].[ext]'
          }
          return 'media/[folder]/[name]-[hash:8].[ext]'
        },
        context: join(sourcePath)
      }
    }
  ]
}

Version data entries

37 entries across 37 versions & 9 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@rails/webpacker/package/rules/file.js
disco_app-0.18.0 test/dummy/node_modules/@rails/webpacker/package/rules/file.js
disco_app-0.18.2 test/dummy/node_modules/@rails/webpacker/package/rules/file.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/@rails/webpacker/package/rules/file.js
webpacker-4.3.0 package/rules/file.js
enju_library-0.3.8 spec/dummy/node_modules/@rails/webpacker/package/rules/file.js
webpacker-5.1.1 package/rules/file.js
webpacker-5.1.0 package/rules/file.js
webpacker-5.0.1 package/rules/file.js
webpacker-5.0.0 package/rules/file.js
jetpacker-0.4.2 package/rules/file.js
jetpacker-0.4.1 package/rules/file.js
jetpacker-0.4.0 package/rules/file.js
jetpacker-0.3.0 package/rules/file.js
jetpacker-0.2.0 package/rules/file.js
webpacker-4.2.2 package/rules/file.js
webpacker-4.2.1 package/rules/file.js
webpacker-4.2.0 package/rules/file.js
webpacker-4.1.0 package/rules/file.js
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/webpacker-4.0.7/package/rules/file.js