rsnext/examples/using-preact/next.config.js
2017-03-06 08:53:00 -08:00

20 lines
645 B
JavaScript

module.exports = {
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
}
config.resolve.alias = {
'react': 'preact-compat/dist/preact-compat',
'react-dom': 'preact-compat/dist/preact-compat'
}
// 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.
config.plugins = config.plugins.filter((plugin) => (plugin.constructor.name !== 'UglifyJsPlugin'))
return config
}
}