Coder Social home page Coder Social logo

elm-kanban's Introduction

Elm 0.18 with Webpack 3, Hot Loading & Bootstrap 4-beta

Elm dev environment with hot-loading (i.e. state is retained as you edit your code - Hot Module Reloading, HMR)). I use this daily for my professional work. Like elm-community/elm-webpack-starter but using Webpack 3.

Installation

Clone this repo into a new project folder and run install script. (I ignore the errors about missing jquery as it is best not to use the Bootstrap jquery-based components with Elm)

With npm

$ git clone [email protected]:simonh1000/elm-webpack-starter.git new-project
$ cd new-project
<remove .git directory>
$ npm install
$ npm run dev

With yarn

$ git clone [email protected]:simonh1000/elm-webpack-starter.git new-project
$ cd new-project
<remove .git directory>
$ yarn install
$ yarn dev

Open http://localhost:3000 and start modifying the code in /src. (An example using Routing is provided in the navigation branch)

Production

Build production assets with:

npm run prod

Static assets

Just add to src/assets/ and the production build copies them to /dist


ES6

If you need to write some Javascript port code, you need to be aware that npm run prod will fail as the uglifyjs plugin provided with Webpack 3 cannot handle ES6. There are a couple of ways forward

  • add babel to transpile to es5 before passing to uglifyjs by modifying the common.module.rules to read:
{
   test: /\.js$/,
   exclude: /node_modules/,
   use: {
       loader: 'babel-loader',
       options: {
           presets: ['latest']
       }
   }
}

You will also need to npm install babel.

Credits

A long time ago this code was forked from https://github.com/fluxxu/elm-hot-loader

elm-kanban's People

Contributors

chrislewispac avatar

Stargazers

Julian Pistorius avatar

Watchers

James Cloos avatar Nate avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.