elm-webpack-project-loader

3.0.3 • Public • Published

elm-webpack-project-loader

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

Usage

  1. Install the node package
npm install elm-webpack-project-loader
  1. Add the .elmproj webpack loader.
module: {
   rules: [{
      test: /\.elmproj$/,
      loader: 'elm-webpack-project-loader',
   }],
 
   noParse: /\.elmproj$/,
},
 
  1. 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$/,
},
 

Readme

Keywords

none

Package Sidebar

Install

npm i elm-webpack-project-loader

Weekly Downloads

8

Version

3.0.3

License

MIT

Unpacked Size

17.8 kB

Total Files

28

Last publish

Collaborators

  • alexmunda
  • joeandaverde