Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vic/elmx-webpack-preloader
Compile elmx to elm files before using elm-webpack-loader
https://github.com/vic/elmx-webpack-preloader
elm elmx webpack-loader webpack-plugin
Last synced: about 1 month ago
JSON representation
Compile elmx to elm files before using elm-webpack-loader
- Host: GitHub
- URL: https://github.com/vic/elmx-webpack-preloader
- Owner: vic
- License: bsd-3-clause
- Created: 2016-04-29T06:42:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T07:13:27.000Z (almost 7 years ago)
- Last Synced: 2024-11-13T12:09:22.865Z (2 months ago)
- Topics: elm, elmx, webpack-loader, webpack-plugin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/elmx-webpack-preloader
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elmx-webpack-preloader
[![help maintain this lib](https://img.shields.io/badge/looking%20for%20maintainer-DM%20%40vborja-663399.svg)](https://twitter.com/vborja)Compile [elmx](https://github.com/pzavolinsky/elmx) to elm files before using [elm-webpack-loader](https://github.com/rtfeldman/elm-webpack-loader)
[Example App](https://github.com/vic/elmx-webpack-boilerplate)
## Installation
```shell
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.```javascript
{
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`
```json
{
"source-directories": [
"src/elm",
".tmp/elm"
]
}
```