Sha256: 4a3ffd3e9c72f9d3a61592ab25d1dbeeb4d09550ebd5940f78a497837979f9f2

Contents?: true

Size: 669 Bytes

Versions: 29

Compression:

Stored size: 669 Bytes

Contents

const { resolve } = require('path')

const isProduction = process.env.NODE_ENV === 'production'
const isDevelopment = process.env.NODE_ENV === 'development'
const elmSource = resolve(process.cwd())
const elmBinary = `${elmSource}/node_modules/.bin/elm`

const options = { 
  cwd: elmSource, 
  pathToElm: elmBinary, 
  optimize: isProduction, 
  verbose: isDevelopment, 
  debug: isDevelopment  
}

const elmWebpackLoader = {
  loader: 'elm-webpack-loader',
  options: options
}

module.exports = {
  test: /\.elm(\.erb)?$/,
  exclude: [/elm-stuff/, /node_modules/],
  use: isProduction ? [elmWebpackLoader] : [{ loader: 'elm-hot-webpack-loader' }, elmWebpackLoader]
}

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/install/loaders/elm.js
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/install/loaders/elm.js
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/install/loaders/elm.js
jetpacker-0.7.0 lib/install/loaders/elm.js
webpacker-5.4.4 lib/install/loaders/elm.js
jetpacker-0.6.0 lib/install/loaders/elm.js
webpacker-5.4.3 lib/install/loaders/elm.js
webpacker-5.4.2 lib/install/loaders/elm.js
webpacker-5.4.1 lib/install/loaders/elm.js
webpacker-5.4.0 lib/install/loaders/elm.js
webpacker-5.3.0 lib/install/loaders/elm.js
webpacker-5.2.2 lib/install/loaders/elm.js
jetpacker-0.5.0 lib/install/loaders/elm.js
webpacker-5.2.1 lib/install/loaders/elm.js
webpacker-4.3.0 lib/install/loaders/elm.js
webpacker-5.2.0 lib/install/loaders/elm.js
webpacker-5.1.1 lib/install/loaders/elm.js
webpacker-5.1.0 lib/install/loaders/elm.js
webpacker-5.0.1 lib/install/loaders/elm.js
webpacker-5.0.0 lib/install/loaders/elm.js