webpack config type improvements

This commit is contained in:
Labhansh Agrawal 2020-01-22 13:39:57 +05:30 committed by Benjamin Staneck
parent 4822ea8fa2
commit 2c7e240474

View file

@ -6,7 +6,7 @@ import webpack from 'webpack';
const nodeEnv = process.env.NODE_ENV || 'development'; const nodeEnv = process.env.NODE_ENV || 'development';
const isProd = nodeEnv === 'production'; const isProd = nodeEnv === 'production';
module.exports = [ const config: webpack.Configuration[] = [
{ {
mode: 'none', mode: 'none',
name: 'hyper-app', name: 'hyper-app',
@ -113,7 +113,7 @@ module.exports = [
resolve: { resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'] extensions: ['.js', '.jsx', '.ts', '.tsx', '.json']
}, },
devtool: isProd ? 'none' : 'cheap-module-source-map', devtool: isProd ? false : 'cheap-module-source-map',
entry: './cli/index.ts', entry: './cli/index.ts',
output: { output: {
path: path.join(__dirname, 'bin'), path: path.join(__dirname, 'bin'),
@ -147,3 +147,5 @@ module.exports = [
target: 'node' target: 'node'
} }
]; ];
export default config;