'webpack command ends with no output if resolver.extensions is specified

I tried various webpack versions (4 and 5) and this is on latest 5.72.1

In my webpack config file I have this:

module: {
  rules: [
    { test: /\.tsx?$/, use: "ts-loader" }
  ]
},
//...
resolve: { 
  extensions: ['.tsx', '.ts', '.js'] 
  //... 
}

When I execute the following command as a npm build script:

webpack --env NODE_ENV=dev --config webpack.dev.config.js

I get no output in console at all, the command returns quickly and no file is created. Note that this is also true if I set stats:'verbose' in the config.

If I remove the "extensions" bit (or, more specifically, if I remove the tsx and ts ones), then the compilation actually takes place, but I'm getting all sorts of resolution errors because it cannot resolve correctly things like "import ../filename" since it doesn't understand that filename has a .ts extension.

I also tried to use https://www.npmjs.com/package/resolve-typescript-plugin both with and without the "extensions" block but it always has the "empty result" behaviour.

Any suggestions on what's going wrong here, or how to force webpack to tell me what's wrong?



Solution 1:[1]

You can follow this documentation to learn how to attach a managed debugger to your Unity IL2CPP UWP build on your HoloLens 2 to enable you setting breakpoints and debug C# code as usual: Managed debugging with Unity

In short:

  1. Check InternetClientServer and PrivateNetworkClientServer in the UWP Publishing Settings Capabilities

  2. Check Development Build, Script Debugging, Wait for Managed Debugger (optional) in the Unity UWP build settings

  3. Build in Unity.

  4. Build and deploy from the Visual Studio solution to your device with the Debug or Release configurations.

  5. Make sure your device is connected to the same network as your PC and start the app on your device and your device is not connected to your PC via USB.

  6. Open any script in Unity and go to the Visual Studio solution that opens to view and edit.

  7. Go to Debug -> Attach Unity Debugger.

  8. Select your device from the list and click "OK" to attach.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hernando - MSFT