Socket
Socket
Sign inDemoInstall

hot-module-accept

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hot-module-accept

One of the dumb yet useful package. This will append hot.module.accept() to your entry file of your project automatically


Version published
Weekly downloads
1
Maintainers
1
Install size
6.73 kB
Created
Weekly downloads
 

Readme

Source

hot-module-accept

This is a simple loader which will append the module.accept() to the bottom of the entry script of your project. So you don't have to worry about having a module statement in the production build.

Works best with webpack-dev-server

Getting Started

  1. Install the package
    npm i hot-module-accept
  2. Modify your webpack config file
    var config = {  
        // Also add 'hot-module-accept' to your existing JS/JSX loaders. 
        //For Example:
        loaders: [
            {
                test: /\.(js|jsx)$/,  
                loaders: [  
                    'babel' //Not necessary for this loader
                    'hot-module-accept'
                ]  
            }
        ]
    }  
    
    The loader will automatically process the entry in your webpack config.
    • If it's a string, then that alone will be your entry file.
    • If it's an array of files, then the last item in that array will be your entry file.
    • If it's a named entry and the value is a string, then it'll be the entry file.
    • If it's an named entry and the value is an array, then the last item in that array will be your entry file.
    Optionally, you can add an entryPoint field to your webpack config also. The loader will treat it as the entry point. It should be a valid string
  • Start hacking!

Keywords

FAQs

Last updated on 02 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc