Comments (6)
I like defaultDestination, and the use of the library name if nothing else is provided. This is pretty much what we used to have with PackMan and worked great.
from librarymanager.
Thanks for the input @acinep .
But should defaultDestination be used as a prefix to the destination of the library (whether provided explicitly or defaulted to the library name)?
{ "version": "1.0", "defaultProvider": "cdnjs", "defaultDestination": "/wwwroot/lib", "libraries": [ { "library": "[email protected]", }, { "library": "[email protected]", "destination": "otherlibs", }, { "library": "[email protected]", "destination": "/foobar", } ] }
Question 1:
In the example above, which folder would the "barlib" files go to?
a - "/otherlibs" (current behavior)
b - "/wwwroot/lib/otherlibs" (defaultDestination prefixed to explicitly set relative destination)
(separately)
Question 2:
Which folder would the "foolib" files go to?
a - "/wwwroot/lib" (current behavior)
b - "/foolib" (default to library name)
c - "/wwwroot/lib/foolib" (defaultDestination prefixed to default library name)
Question 3:
Which folder would the "foobar" files go to? (Note the destination start with "/")
a - "/foobar" (current behavior)
b - "/wwwroot/bin/foobar" (defaultDestination prefixed to explicitly set root path)
from librarymanager.
Or should we introduce a new property for the destination prefix?
from librarymanager.
If defaultDestination is prefixed in both cases, question 1 & 2 above, then you wouldn't be able to dump a file directly lib folder such as /wwwroot/lib/coollib.js. I suppose you could specify destination as /wwwroot/lib.
I guess developers either want their libraries in library subfolders or they don't. Maybe a property could be added such as "useLibraryFolders"? Then you could set it to the true or false and get the behavior you like best.
from librarymanager.
Thanks @mattfraley1.
Yes, the design is that a forward slash ("/") at the beginning of the destination would indicate that the destination is relative to the root of the project.
ie. "/scripts" would send files to the [root]/scripts, but
"scripts" would send files to [defaultDestinationFolder]/scripts.'
Thanks for the suggestion about "useLibraryFolders". We will consider that!
from librarymanager.
@justcla I expected it to work like this, but unfortunately, it's not implemented yet.
Question 1: B
Question 2: A
Question 3: A
The useLibraryFolders would be nice, you should be able to override this behavior by setting the destination in the library setting.
Example:
{
"version": "1.0",
"defaultProvider": "unpkg",
"defaultDestination": "Assets/Libraries/",
"useLibraryFolders": true,
"libraries": [
{
"library": "[email protected]",
"destination": "jquery-custom" // Assets/Libraries/jquery-custom/ (custom library folder)
},
{
"library": "[email protected]" // Assets/Libraries/bootstrap/
},
{
"library": "[email protected]",
"destination": "" // Assets/Libraries/coollib.js (overrides useLibraryFolders)
},
{
"library": "[email protected]",
"destination": "/foobar" // foobar (overrides root defaultDestination)
}
]
}
This will give you full flexibility.
from librarymanager.
Related Issues (20)
- [Docs] Bundle, minify, etc. HOT 2
- LibMan CLI returns zero exit code even when there was an error
- [MSBuild Task] cannot restore a pattern HOT 1
- Libraries could not be resolved by the "cdnjs" provider HOT 73
- restoring packages from cdnjs is failing HOT 2
- Suggestion: Adding additional 3rd party CDN HOT 5
- Seeminlgly random LIB003 HOT 9
- Library Manager tool does not work on Visual Studio 2022 HOT 20
- Package Microsoft.Web.LibraryManager.Cli 2.1.175 is not compatible with net6.0 HOT 1
- Allow specifying destination per file HOT 7
- Lowering importance of informational messages from `RestoreTask`
- Add macOS Arm64 support to the CLI tool HOT 4
- libman does not allow defining the bootstrap package twice (without ignoring one of them).
- Restore operations happen in foreground in Class Library projects in Visual Studio
- libman: library could not be resolved by 'cdnjs' provider AGAIN HOT 8
- Switch to MIT license
- Consolidate Nuget feed
- version 2.1.175 doesn't support .Net 7.0.11 HOT 9
- Error during restore mentioning libman.config.json in use.
- "[email protected]" library could not be resolved HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from librarymanager.