How to make a switch case in Typescript for the webpack.config.ts?
<p>I'm having trouble with the syntax with typescript and webpack 2 config file:</p>

<p>The javascript equivalent is:</p>

<pre><code>switch (process.env.BUILD_ENV) {
    case 'live':
        module.exports = require('./config/webpack.live');
        break;
    case 'debug':
        module.exports = require('./config/webpack.debug');
        break;
    default:
        module.exports = require('./config/webpack.doesntexist');
}
</code></pre>

<p>Webpack 2 takes a TS config file, so I tried changing this part to this:</p>

<pre><code>switch (process.env.BUILD_ENV) {
case 'live':
    export * from './config/webpack.live';
    break;
case 'debug':
    export * from './config/webpack.debug';
    break;
default:
    export * from './config/webpack.doesntexist';
}
</code></pre>

<p>I'm getting the error: "an export declaration can only be used in a module". But It's not clear to me what this means. How can I correct this in typescript? Or is this not the way to build your configs in webpack 2?</p>