https://github.com/jsdf/hot-site
convention-over-configuration webpack dev server with hot module replacement and less boilerplate
https://github.com/jsdf/hot-site
Last synced: about 2 months ago
JSON representation
convention-over-configuration webpack dev server with hot module replacement and less boilerplate
- Host: GitHub
- URL: https://github.com/jsdf/hot-site
- Owner: jsdf
- Created: 2015-11-22T01:55:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-22T02:02:07.000Z (over 9 years ago)
- Last Synced: 2025-03-06T06:40:48.876Z (about 2 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hot-site
a convention-over-configuration webpack dev server with hot module replacementπ‘spin up new projects faster and with less boilerplate
## usage
```
npm init
npm install --save hot-site
```directory structure:
```
your_project/
βββ index.html
βββ package.json
βββ src
βΒ Β βββ index.js
βββ webpack.config.js
````webpack.config.js`:
```js
var makeHotSiteConfig = require('hot-site/makeConfig');module.exports = makeHotSiteConfig({
// your webpack config here
});
````package.json`:
```json
{
"scripts": {
"start": "hot-site"
}
}
````index.html`
```html
```
```
npm start
open http://localhost:8080/
```### opinionated setup: babel, css modules, react-transform-hmr
```
npm install --save [email protected] [email protected] babel-plugin-react-transform react-transform-hmr style-loader css-loader
````webpack.config.js`:
```js
var makeHotSiteConfig = require('hot-site/makeConfig');module.exports = makeHotSiteConfig({
devtool: 'cheap-eval-sourcemap',
module: {
loaders: [
{
test: /\.css$/,
loader: "style-loader!css-loader?modules",
},
{
test: /\.js$/,
loaders: ['babel'],
exclude: 'node_modules',
}
],
},
});
````.babelrc`:
```js
{
"stage": 0,
"env": {
"development": {
"plugins": ["react-transform"],
"extra": {
"react-transform": {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}]
}
}
}
}
}
```