Created
February 15, 2019 16:05
-
-
Save zwilias/18c2e87777197450146728e9b8626dcd to your computer and use it in GitHub Desktop.
adapted from https://github.com/elm-community/elm-webpack-loader/blob/master/example-wp4/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
require('./index.html'); | |
var Elm = require('./Main.elm'); | |
console.log(Elm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require("path"); | |
module.exports = { | |
// If your entry-point is at "src/index.js" and | |
// your output is in "/dist", you can ommit | |
// these parts of the config | |
module: { | |
rules: [ | |
{ | |
test: /\.html$/, | |
exclude: /node_modules/, | |
loader: "file-loader?name=[name].[ext]" | |
}, | |
{ | |
test: /\.elm$/, | |
exclude: [/elm-stuff/, /node_modules/], | |
// This is what you need in your own work | |
// loader: "elm-webpack-loader", | |
loader: "../index.js", | |
options: { | |
debug: true, | |
files: [ | |
path.resolve(__dirname, "src/Main.elm"), | |
path.resolve(__dirname, "src/Other.elm") | |
] | |
} | |
} | |
] | |
}, | |
devServer: { | |
inline: true, | |
stats: "errors-only" | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment