-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimal elm app with webpack run and build
- Loading branch information
0 parents
commit f2f2318
Showing
7 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
elm-stuff/ | ||
node_modules/ | ||
tmp/ | ||
dist/ | ||
aws-config.json | ||
npm-debug.* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": "1.0.0", | ||
"summary": "helpful summary of your project, less than 80 characters", | ||
"repository": "https://github.com/user/project.git", | ||
"license": "BSD3", | ||
"source-directories": [ | ||
"src" | ||
], | ||
"exposed-modules": [], | ||
"dependencies": { | ||
"elm-lang/core": "5.1.1 <= v < 6.0.0", | ||
"elm-lang/html": "2.0.0 <= v < 3.0.0" | ||
}, | ||
"elm-version": "0.18.0 <= v < 0.19.0" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "progessive-elm-app", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "webpack.config.js", | ||
"scripts": { | ||
"build": "webpack --mode=production", | ||
"start": "webpack-dev-server --port 3000 --mode=development" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"webpack-cli": "^3.0.8" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Html | ||
|
||
main : Html.Html msg | ||
main = Html.text "Hello World" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Elm SPA example</title> | ||
</head> | ||
<body> | ||
<div id="main"></div> | ||
<script src="/app.js"></script> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
// Require index.html so it gets copied to dist | ||
require('./index.html'); | ||
|
||
var Elm = require('./Main.elm'); | ||
var mountNode = document.getElementById('main'); | ||
|
||
// .embed() can take an optional second argument. This would be an object describing the data we need to start a program, i.e. a userID or some token | ||
var app = Elm.Main.embed(mountNode); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var path = require("path"); | ||
|
||
module.exports = { | ||
entry: { | ||
app: [ | ||
'./src/index.js' | ||
] | ||
}, | ||
|
||
output: { | ||
path: path.resolve(__dirname + '/dist'), | ||
filename: '[name].js', | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.html$/, | ||
exclude: /node_modules/, | ||
loader: 'file-loader?name=[name].[ext]', | ||
}, | ||
{ | ||
test: /\.elm$/, | ||
exclude: [/elm-stuff/, /node_modules/], | ||
loader: 'elm-webpack-loader?verbose=true&warn=true', | ||
} | ||
], | ||
|
||
noParse: /\.elm$/, | ||
}, | ||
|
||
devServer: { | ||
inline: true, | ||
stats: { colors: true }, | ||
}, | ||
|
||
}; |