# angularjs-hot-loader

> AngularJS Hot module replacement

Latest version **0.0.2** (published 2017-10-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install angularjs-hot-loader
pnpm add angularjs-hot-loader
yarn add angularjs-hot-loader
bun add angularjs-hot-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2017-10-03 |
| First published | 2017-09-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dimpu Aravind Buddha |
| Maintainers | dimpu |
| Keywords | AngularJs, webpack, HMR, hot repalcment |

## Links

- npm: https://www.npmjs.com/package/angularjs-hot-loader
- Repository: https://dimpu@github.com/dimpu/angularjs-hot-loader
- Homepage: https://github.com/dimpu/angularjs-hot-loader#readme
- Issues: https://github.com/dimpu/angularjs-hot-loader/issues
- npm.io page: https://npm.io/package/angularjs-hot-loader

## Dependencies (1)

- [source-map](https://npm.io/package/source-map.md) ^0.4.2

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2017-10-03
- 0.0.1 — 2017-09-23

## README

# AngularJS Hot replacement for webpack

[![Join the chat at https://gitter.im/dimpu/angularjs-hot-loader](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dimpu/angularjs-hot-loader?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A  Webpack loader for Hot Module Replacement in AngularJS applications.

This will only work in Ui Router at the moment with a specific app structure shown below. Will work on it a bit more over the week.

Throwing up a sample app up at https://github.com/dimpu/angularjs-hot-loader

## How to use

webpack.config.js

```js
const path = require('path');
const webpack = require('webpack');

module.exports = {
    entry: [
        'webpack-dev-server/client?http://localhost:3000',
        'webpack/hot/only-dev-server',

        './src/index.js'
    ],
    output: {
        path: path.resolve(__dirname, 'dist'),
        publicPath: '/dist/',
        filename: 'index.bundle.js'
    },
    module: {
        rules: [{
                test: /\.js$/,
                use: [
                    // 'angularjs-hot-loader',
                    '../index',
                    'babel-loader'
                ],
                exclude: /node_modules/
            }

        ]
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin(),
        new webpack.NoEmitOnErrorsPlugin()
    ],

    devServer: {
        host: 'localhost',
        port: 3000,

        historyApiFallback: true,
        // respond to 404s with index.html

        hot: true,
        // enable HMR on the server
    },
}
```



```
angular
  .module('app.components')
  .directive('sessionItem',function() {
    return {
        restrict : 'E',
        scope: {
            session: '='
        },
        bindToController: true,
        controllerAs: 'state',
        replace: true,
        controller: 'sessionItemCtrl',
        template: require('./template.html')
    };
  })
  .factory('TestFactory', function() {
    console.log('derp');
  })
  .controller('sessionItemCtrl', require('./sessionItemCtrl'));
```

and you save that the browser should refresh

---
_Source: https://npm.io/package/angularjs-hot-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
