platypi / less-bundle Goto Github PK
View Code? Open in Web Editor NEWA package bundler for Less
License: MIT License
A package bundler for Less
License: MIT License
We're using less-bundle
in a TS package of ours. We're building our package with tsc --build
with the following config:
{
"compilerOptions": {
"declarationDir": "./dist",
"emitDeclarationOnly": false,
"module": "CommonJS",
"outDir": "./dist",
"rootDir": "./src",
"target": "ESNext",
"composite": true,
"incremental": true,
"lib": ["DOM", "ESNext"],
"importHelpers": true,
"declarationMap": false,
"declaration": true,
"sourceMap": false,
"strict": true,
"noEmitOnError": true,
"noImplicitAny": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"isolatedModules": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "Node",
"jsx": "react",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"resolveJsonModule": true
},
"include": ["./src"]
}
When launching the build, we're getting TS errors from less-bundle
:
There is a dedicated parameter in TS to ignore libraries TS errors called skipLibCheck
. However the way it works is by ignoring all d.ts
declaration files.
As there is none produced by less-bundle
, and as the entry file of the library is a index.ts
file, we're getting those TS errors with no straightforward way of working around them. To be fair, one could also argue that it is a lack of configuration on TS's side.
Anyway, this keeps us from building our package, and blocks us.
In the meantime, to unblock ourselves, we forked your repo and added to it a configuration that would fit to our situation, by generating declaration files from your code.
Is this a problem your planning on solving?
If not, would you like us to open a PR on this repo with the changes we made on the fork?
Importing from node_modules has become a common pattern, and looks like the following:
@import ~@organization/package/components/component/styles/styles.less
Currently, less-bundle
takes the path literally.
c:\project\styles\~@organization/package/components/component/styles/styles.less
It'd be great if this package could support substituting node_modules
in when appropriate! I'll be submitting a PR shortly that should address the issue.
I tried this and it worked well but one thing that I want is to return bundled less content/string in callback or we can convert this to use promises that would be awesome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.