1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-08 23:25:02 +00:00
mon-entreprise/source/webpack.dev.js

48 lines
1,015 B
JavaScript
Raw Normal View History

2018-07-12 10:09:41 +02:00
const { map, concat } = require('ramda')
const webpack = require('webpack')
const common = require('./webpack.common.js')
const webpackServeWaitpage = require('webpack-serve-waitpage')
const history = require('connect-history-api-fallback')
const convert = require('koa-connect')
2018-07-17 17:36:27 +02:00
module.exports = {
...common,
2018-03-01 20:30:57 +01:00
mode: 'development',
2018-07-12 10:09:41 +02:00
entry: map(concat(['react-hot-loader/patch']), common.entry),
serve: {
host: '0.0.0.0',
hotClient: {
allEntries: true,
host: { client: '*', server: '0.0.0.0' }
},
2018-07-12 10:09:41 +02:00
add: (app, middleware, options) => {
app.use(
convert(
history({
rewrites: [
{
from: /^\/embauche\/.*$|^\/embauche$/,
2018-07-12 10:09:41 +02:00
to: '/embauche.html'
},
{
from: /^\/infrance\/.*$|^\/infrance$/,
to: '/infrance.html'
2018-07-12 10:09:41 +02:00
}
]
})
)
)
app.use(
webpackServeWaitpage(options, {
theme: 'material'
})
)
}
},
plugins: [
...common.plugins,
2018-07-12 10:09:41 +02:00
new webpack.EnvironmentPlugin({ NODE_ENV: 'development' })
]
}