Skip to content

TypeScript conditional import via require (webpack) based on environment variable #1

Closed
@topheman

Description

@topheman

Example code: https://github.com/topheman/angular2-sandbox/blob/master/src/bootstrap.ts#L60

I deliver two version of the bundle:

  • one fully optimized, without any devtools
  • one not minified, containing sourcemaps, but specifically, shipping dev features based on dev packages which I don't want in the production one.

The bundle is based on the env var process.env.DEVTOOLS. This works with Babel/Webpack (example on an other project)

I've tried multiple things, I can't get it to work with TypeScript ...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions