0

I created a library and would like to debug it in the web application that imports it. I can find the code with the chrome debugger tool when I search for a library method in a related file for example. However, that code is minified and hard to read. Is there a way to tell Nuxt/Vue not to minify the file for all or a particular library?

  • Sorry if I've misunderstood your question, but are you just looking to disable minification when building a Nuxt app? Or are you looking for a way to prevent *just your* library from getting minified in other Nuxt apps that import it? The former is very straightforward, the latter is impossible as you have no control over the build process if somebody else chooses to import your library into their application. – Nick Dawes Nov 25 '21 at 15:51
  • Hi Thank for your reply. That would be the latter, looking to prevent my library from getting minified. The thing is that I'm in control of that library. It is another vue.js 2.6 app. I need to know where in my created library I can disable minification. FYI I'm using [yalc](https://www.npmjs.com/package/yalc) to quickly export my library to my main web app and test it. – Nick Zozor Nov 25 '21 at 18:55
  • The question doesn't make sense without a mention of a specific library. It's possible that you already import minified bundle. – Estus Flask Nov 25 '21 at 19:22
  • Ah I see :) I’m not sure you can do this from within your library— however if you’re in control of the build process of the other apps, have you looked at Webpack externals? This may be useful https://stackoverflow.com/questions/33915826/exclude-module-from-webpack-minification – Nick Dawes Nov 25 '21 at 19:41
  • It's a library that I created myself. I have it on my local and publish it on my local npm repo using yalc. The question is what are my options to disable minification on that vue.js library that I created own. To update my library I update the source code, a vue file in general then save it. I publish with the command yalc publish -push. My main app then gets the new updates. I refresh my main app and see the changes but the code of my library is minified – Nick Zozor Nov 25 '21 at 19:42
  • @NickDawes yes it's probably a webpack option to set but I can't find how to do this with vue. I used Angular recently and i could tell my main package.json to include sourcemap for external libraries. I could debug with clean and unminified code from web console – Nick Zozor Nov 25 '21 at 19:50

0 Answers0