New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

elm-webpack-project-loader

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elm-webpack-project-loader

Webpack Loader for Elm Projects.

3.0.3
latest
Version published
Weekly downloads
384
-12.93%
Maintainers
2
Weekly downloads
 
Created

elm-webpack-project-loader

Specify location of main modules to build using an elm project file.

Usage

  • Install the node package
npm install elm-webpack-project-loader
  • Add the .elmproj webpack loader.
module: {
   rules: [{
      test: /\.elmproj$/,
      loader: 'elm-webpack-project-loader',
   }],

   noParse: /\.elmproj$/,
},

  • Require an elm project file
var Elm = require('./path-to-elm-project.elmproj')

Project File Structure

A JSON file that specifies the location of the elm.json, the main files to build, and the root of your project files.

Assuming the file structure:

/app
   /src
   |   /elm
   |----  /Components
   |-------- /WidgetA
   |----------- Main.elm
   |-------- /WidgetB
   |----------- Main.elm
   |
   elm.json
   my-app.elmproj

The .elmproj file

{
   "elm-json-dir": "./",
   "main-modules": [
      "./src/elm/Components/WidgetA/Main.elm",
      "./src/elm/Components/WidgetB/Main.elm"
   ]
}

Using the Elm Debugger

Append the 'debug' query string to the end of the loader.

module: {
   rules: [{
      test: /\.elmproj$/,
      loader: 'elm-webpack-project-loader?debug=true',
   }],

   noParse: /\.elmproj$/,
},

FAQs

Package last updated on 23 Oct 2019

Did you know?

Socket

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