Can't compile nested less files with Web Compiler 2015

人盡茶涼 提交于 2019-12-06 02:30:49
jpdedmon

I had the same problem. Web Compiler failed in many ways and the workarounds were messy and wouldn't have been easy to support. Future versions of Web Compiler might be useful, but I came to the conclusion that it's worth the trouble to just switch to a more mature less compiling tool.

This is what worked for me: Disable Web Compiler Tools->Extensions and Updates->Installed(search for Web Compiler)->Disable

Then setup Grunt.js by following one of the many tutorials out there. I used this one by Scott Hanselman: http://www.hanselman.com/blog/IntroducingGulpGruntBowerAndNpmSupportForVisualStudio.aspx

Here's another guide I found very useful: https://www.orderfactory.com/articles/Bootstrap-LESS-Grunt-VS.html

Since it sounds like you were basically where I was before I followed these instructions, there's a chance you might run into another issue with TypeScript compiling, which Web Compiler turned on by default.

If you get a bunch of "duplicate identifier" errors related to lib.core.d.ts, you may have to disable automatic typescript compiling: right-click Project->Properties->TypeScript Build->uncheck "Compile on save"

Installing Web Compiler and setting up node tools and assigning an automated task can result in unleashing the ts compiler to run through all the node_modules, looking for things to compile. It can be a mess.

If you want to leave TypeScript compiling on build, you'll need to add a tsconfig.json file to the root of your project to define specific file paths. Without this file, the compiler looks everywhere and you really don't want that. I found it easier to just disable it.

Here's more information on that: Typescript, confusing "duplicate identifier" error message

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!