mon-entreprise/source/webpack.dev.js

42 lines
884 B
JavaScript
Raw Normal View History

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')
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'
})
)
}
},
plugins: [
...common.plugins,
2018-07-12 08:09:41 +00:00
new webpack.EnvironmentPlugin({ NODE_ENV: 'development' })
]
}