-
-
Notifications
You must be signed in to change notification settings - Fork 40
Webpack build issue when importing from platform specific ts files #306
Comments
I can confirm that this is an issue with the latest version of
The following imports doesn't work if you try the bundle the project:
However, as a workaround one can use
Importing the file as-is, also works:
The last case explains why importing |
Thinking about the issue again, I realized that this is actually the expected behavior for the TypeScript compiler. The right fix is to add a common d.ts file for the platform specific files. For example if you have
you need to add a declarations file:
This will allow tsc to resolve imports like:
The declaration files can be generated automatically, but you need to keep in mind that they should match the name of the imports ( |
I have a project which was building properly with previous versions of libraries.
I have updated to version 0.5.0 and webpack 3.x.x.
Previous versions were 0.3.7 and webpack 2.2.0.
Now updating to the latest libraries I get the following errors.
Those missing files are delegates specific to the platform. For example app-delegate.android.ts and app-delegate.ios.ts.
The previous build process showed the issues as warning in yellow, but the current one shows them as errors and build is stopped.
I would be good to understand why it was working before but not now, why it was treated as warnings before, but now as errors, and if there can be some tweaks either on tsconfig, or webpack config.
Also how should platform independent code should be included.
Thanks.
The text was updated successfully, but these errors were encountered: