2018-07-12 08:09:41 +00: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-03-01 18:39:36 +00:00
|
|
|
module.exports = {
|
|
|
|
...common,
|
2018-03-01 19:30:57 +00:00
|
|
|
mode: 'development',
|
2018-07-12 08:09:41 +00:00
|
|
|
entry: map(concat(['react-hot-loader/patch']), common.entry),
|
|
|
|
serve: {
|
|
|
|
add: (app, middleware, options) => {
|
|
|
|
app.use(
|
|
|
|
convert(
|
|
|
|
history({
|
|
|
|
rewrites: [
|
|
|
|
{
|
|
|
|
from: /^\/infrance\/.*$/,
|
|
|
|
to: '/infrance.html'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: /^\/embauche\/.*$/,
|
|
|
|
to: '/embauche.html'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
})
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
app.use(
|
|
|
|
webpackServeWaitpage(options, {
|
|
|
|
theme: 'material'
|
|
|
|
})
|
|
|
|
)
|
|
|
|
}
|
2018-03-01 18:39:36 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
2018-07-04 17:45:43 +00:00
|
|
|
...common.plugins,
|
2018-07-12 08:09:41 +00:00
|
|
|
new webpack.EnvironmentPlugin({ NODE_ENV: 'development' })
|
2018-03-01 18:39:36 +00:00
|
|
|
]
|
|
|
|
}
|