GithubHelp home page GithubHelp logo

dynajoe / elm-hot-loader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fluxxu/elm-hot-loader

0.0 1.0 0.0 904 KB

Hot Module Replacement for Elm using webpack.

License: MIT License

JavaScript 100.00%

elm-hot-loader's Introduction

Elm Hot Loader Version

Hot code swapping for Elm.

This loader injects HMR support code to the Elm module generated by elm-webpack-loader.

NPM

Change Log

0.5.0

  • Elm 0.18 support

0.4.0

0.3.3

  • Better elm-lang/websocket support (thanks to @rundis)

0.3.1

  • Don't error when there are no ports (thanks to @glenjamin)

0.3.0

  • Elm 0.17 support
  • swap port and EmptyAction are gone. Enable this loader and it just works.
  • Incoming ports still work after hot swapping

Installation

$ npm install --save elm-webpack-loader elm-hot-loader

Usage

Documentation: Using loaders

In your webpack.config.js file:

module.exports = {
  module: {
    loaders: [{
      test: /\.elm$/,
      exclude: [/elm-stuff/, /node_modules/],
      loader: 'elm-hot!elm-webpack'
    }]
  }
};

If you don't use elm-webpack-loader to compile Elm, just make sure webpack uses elm-hot to load your compiled js file. Add this to your webpack config file:

loaders: [
  // ...
  {
      test: /[YOUR_COMPILED_JS_FILE_NAME_HERE]\.js$/,
      loader: 'elm-hot'
  }
  // ...
]

You should also add the --hot flag when starting webpack.

Dependency

This loader relies on elm-webpack-loader to compile Elm to JS.

Example

You can find an example project at elm-hot-loader-starter.

elm-hot-loader's People

Contributors

anagrius avatar bjrnt avatar fluxxu avatar glenjamin avatar jmfirth avatar stkb avatar

Watchers

 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.