Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dynajoe/elm-webpack-project-loader
https://github.com/dynajoe/elm-webpack-project-loader
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dynajoe/elm-webpack-project-loader
- Owner: dynajoe
- Created: 2016-03-08T21:01:03.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T02:28:02.000Z (about 2 years ago)
- Last Synced: 2024-04-15T02:15:04.617Z (9 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 11
- Watchers: 3
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# elm-webpack-project-loader
Specify location of main modules to build using an elm project file.
## Usage
1. Install the node package
```bash
npm install elm-webpack-project-loader
```2. Add the `.elmproj` webpack loader.
```javascript
module: {
rules: [{
test: /\.elmproj$/,
loader: 'elm-webpack-project-loader',
}],noParse: /\.elmproj$/,
},```
3. Require an elm project file
```javascript
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**
```json
{
"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.
```javascript
module: {
rules: [{
test: /\.elmproj$/,
loader: 'elm-webpack-project-loader?debug=true',
}],noParse: /\.elmproj$/,
},```