-
Notifications
You must be signed in to change notification settings - Fork 516
Allow webpack configs to be authored in typescript (fixes #1241) #1301
Conversation
I can't seem to get the solution to build, are there any instructions I can follow? I'm using VS2017 |
Okay, so I can test the theory myself and am in the process of doing so. Assuming the c# side works okay it's the TS we need to consider. Thus I'm using the following middleware options to mock the c# new WebpackDevMiddlewareOptions
{
ConfigFile = "webpack.config.ts"
} I have modified my node_modules copy of By running this I've now found that using Typescript we define the config and use: A bit of logging has revealed that we receive the following object Having come across this issue microsoft/TypeScript#2719 I have tested and found that |
Right, yes, my imitation of this fix suggests it should work :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested those changes and they seem to work fine.
Can we please get this PR merged in? I really would like to jettison the javascript webpack config. |
I saw an update but these changes were still missing |
Why is getting user contributions in on this project so challenging? |
@SteveSandersonMS I've resolved the conflicts created by the fix for #1378 - can you get this merged or reviewed so I don't have to maintain it please. |
Thanks for this @AdamWillden. I'm planning to make a change to how this is implemented so that people can get the new functionality just from an updated NPM package without also needing an updated NuGet package (in other words, by implementing it without any C# changes). This is because we can ship updates to the NPM package almost any time, whereas NuGet packages only ship when ASP.NET itself ships. So, please don't feel compelled to maintain this PR in any way in the meantime. |
@SteveSandersonMS works for me considering we'll get the update sooner that way. Thanks for the response |
I've been working around this using a file called require('ts-node/register')
module.exports = require("./webpack.config.ts"); And then using new WebpackDevMiddlewareOptions
{
ConfigFile = "webpack.dev.js"
} But to be able to use them natively would be great |
This is now implemented in a way that doesn't require new .NET packages: b2373e1 |
Very nice, what version is/will this change be in? |
2.0.3, hopefully today |
@SteveSandersonMS good to make your acquaintance again (a nod from my KnockoutJS days, although you won't remember me)
This fix is entirely untested and simply following your instructions so we can get the ball rolling. Is this really all that's needed for the typescript to get parsed on demand??
I'll try and see if I can build the solution, replace the DLL and node_modules in my project and confirm the fix.