Socket
Socket
Sign inDemoInstall

elmx-webpack-preloader

Package Overview
Dependencies
20
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    elmx-webpack-preloader

Webpack preloader to pre-compile elmx into elm files.


Version published
Weekly downloads
6
increased by500%
Maintainers
1
Install size
1.43 MB
Created
Weekly downloads
 

Readme

Source

elmx-webpack-preloader

help maintain this lib

Compile elmx to elm files before using elm-webpack-loader

Example App

Installation

npm install --save-dev elmx-webpack-preloader

Usage

Add the preload to your webpack config. Any .elmx dependency will be compiled to an .elm file.

If no outputDirectory is specified, the compiled elm will be placed in the same directory as it's elmx source.

{
  module: {
    preLoaders: [
      {
        // Notice that the preloader actually reads .elm files looking for dependencies to be compiled from elmx
        test: /\.elm$/,
        loader: 'elmx-webpack-preloader',
        include: [join(__dirname, "src/elm")],
        query: {
          sourceDirectories: ['src/elm']
          outputDirectory: '.tmp/elm'
        }
      }
    ],
    loaders: [
      {
        test: /\.elm$/,
        loader: 'elm-webpack',
        include: [join(__dirname, "src/elm"), join(__dirname, ".tmp/elm")]
      }
    ]
  }
}

When using an outputDirectory make sure to include it on your elm-package.json

{
    "source-directories": [
        "src/elm",
        ".tmp/elm"
    ]
}

Keywords

FAQs

Last updated on 19 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc