2016-12-27 18:58:10 +00:00
|
|
|
module.exports = {
|
2017-03-05 01:47:56 +00:00
|
|
|
webpack: function (config, { dev }) {
|
|
|
|
// For the development version, we'll use React.
|
|
|
|
// Because, it support react hot loading and so on.
|
|
|
|
if (dev) {
|
|
|
|
return config
|
|
|
|
}
|
|
|
|
|
2016-12-27 18:58:10 +00:00
|
|
|
config.resolve.alias = {
|
2017-01-13 14:40:07 +00:00
|
|
|
'react': 'preact-compat/dist/preact-compat',
|
|
|
|
'react-dom': 'preact-compat/dist/preact-compat'
|
2016-12-27 18:58:10 +00:00
|
|
|
}
|
2017-03-05 01:47:56 +00:00
|
|
|
|
|
|
|
// Disable uglify. This has been fixed in https://github.com/developit/preact-compat/issues/155.
|
|
|
|
// Can be removed once there is a new preact-compat release.
|
2017-03-06 16:53:00 +00:00
|
|
|
config.plugins = config.plugins.filter((plugin) => (plugin.constructor.name !== 'UglifyJsPlugin'))
|
2017-03-05 01:47:56 +00:00
|
|
|
|
2016-12-27 18:58:10 +00:00
|
|
|
return config
|
|
|
|
}
|
|
|
|
}
|