├── .gitignore ├── LICENSE ├── README.md ├── elm.json ├── netlify.toml ├── package.json ├── src ├── Main.elm ├── elm.js └── index.html └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist/ 3 | .cache 4 | elm-stuff 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Joël Quenneville 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Minimal Elm + Parcel deploy to Netlify 2 | 3 | [](https://app.netlify.com/sites/elm-netlify-parcel/deploys) [](https://app.netlify.com/start/deploy?repository=https://github.com/JoelQ/elm-netlify-parcel) 4 | 5 | This is a minimal example [Elm](https://elm-lang.org) app that is deployed to 6 | [Netlify](https://www.netlify.com/) (see the [live site](https://elm-netlify-parcel.netlify.app/)). 7 | 8 | ## Using this yourself 9 | 10 | This is a [GitHub template repository](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template) 11 | which allows you to initialize your own repo with the same files and directories 12 | as this (but not the history). To start using, click the big "Use this template" 13 | button at the top of the page. 14 | 15 | ## Setup without parcel 16 | 17 | Looking for something more minimal that doesn't involve Parcel? Checkout the 18 | [sister `elm-netlify-minimal` project](https://github.com/JoelQ/elm-netlify-minimal). 19 | 20 | ## License 21 | 22 | The repo is provided under the [MIT License](LICENSE). 23 | -------------------------------------------------------------------------------- /elm.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "application", 3 | "source-directories": [ 4 | "src" 5 | ], 6 | "elm-version": "0.19.1", 7 | "dependencies": { 8 | "direct": { 9 | "elm/browser": "1.0.2", 10 | "elm/core": "1.0.5", 11 | "elm/html": "1.0.0" 12 | }, 13 | "indirect": { 14 | "elm/json": "1.1.3", 15 | "elm/time": "1.0.0", 16 | "elm/url": "1.0.0", 17 | "elm/virtual-dom": "1.0.2" 18 | } 19 | }, 20 | "test-dependencies": { 21 | "direct": {}, 22 | "indirect": {} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "dist/" 3 | command = "yarn parcel build src/index.html --public-url '.'" 4 | 5 | [build.environment] 6 | ELM_HOME = "$NETLIFY_BUILD_BASE/cache/elm" 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "elm": "^0.19.1-3", 4 | "elm-hot": "^1.1.5", 5 | "node-elm-compiler": "^5.0.5", 6 | "parcel": "^1.12.4" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Main.elm: -------------------------------------------------------------------------------- 1 | module Main exposing (main) 2 | 3 | import Html exposing (Html) 4 | import Html.Attributes 5 | 6 | 7 | main : Html a 8 | main = 9 | Html.section [] 10 | [ Html.h1 [] [ Html.text "Minimal Elm + Parcel implementation, deployed to Netlify" ] 11 | , Html.p [] 12 | [ Html.text "Find the source on " 13 | , Html.a [ Html.Attributes.href "https://github.com/JoelQ/elm-netlify-parcel" ] [ Html.text "GitHub" ] 14 | ] 15 | ] 16 | -------------------------------------------------------------------------------- /src/elm.js: -------------------------------------------------------------------------------- 1 | import { Elm } from './Main.elm' 2 | 3 | Elm.Main.init({ 4 | node: document.querySelector('#elm'), 5 | flags: {} 6 | }) 7 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |