https://github.com/deltacircuit/hot-module-accept
A dumb yet useful loader. This 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.
https://github.com/deltacircuit/hot-module-accept
hmr hmr-enabler loader webpack
Last synced: about 2 months ago
JSON representation
A dumb yet useful loader. This 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.
- Host: GitHub
- URL: https://github.com/deltacircuit/hot-module-accept
- Owner: DeltaCircuit
- License: mit
- Created: 2017-01-11T07:48:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T17:08:47.000Z (over 8 years ago)
- Last Synced: 2024-02-03T05:05:35.861Z (over 2 years ago)
- Topics: hmr, hmr-enabler, loader, webpack
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hot-module-accept
[](https://travis-ci.org/giridharangm/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
```javascript
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!