NativeScript / worker-loader

36 stars 20 forks source link

Build error #11

Closed tobydeh closed 6 years ago

tobydeh commented 6 years ago

I created a plugin for a project which uses a worker script on android: https://github.com/tobydeh/nativescript-download-progress

I tried to build the project with webpack which caused issues with the plugin.

I updated my plugin & demo to support webpack and everything runs correctly.

When I use the plugin in my project i get the following build error:

ERROR in ../node_modules/nativescript-download-progress/download-progress.js!../node_modules/nativescript-download-progress/android-worker.js
Module build failed: Error: Cannot find module '...<development path>.../node_modules/nativescript-download-progress/download-progress.js'

The only difference between my project and the demo is that my project uses typescript + angular and the plugin demo is plain typescript.

All of my webpack config is default and the project builds fine if i don't include the plugin. It also builds fine if i don't use the webpack --bundle flag.

Why has require("nativescript-worker-loader!./android-worker.js"); been changed to require("nativescript-download-progress!./android-worker.js");

tobydeh commented 6 years ago

Everything builds and works correctly when i run tns run ios --bundle the error only appears when building for Android.