Skip to content
This repository was archived by the owner on Mar 15, 2021. It is now read-only.

Support for Source map #3

Closed
SeabassNg opened this issue Feb 3, 2016 · 5 comments
Closed

Support for Source map #3

SeabassNg opened this issue Feb 3, 2016 · 5 comments

Comments

@SeabassNg
Copy link

Would be nice to have a source map to point where in the less file the code is from

@agabrys
Copy link
Contributor

agabrys commented Feb 8, 2016

This library is not responsible for compiling sources (and also generating source maps) ;-) It only wraps native compiler (see lesscss-compiler) and extends it (files cache and different protocols support). I think that you can generate source map by using compiler options - I will check this. If this is available, then I will try to prepare nice API for this :-)

@agabrys
Copy link
Contributor

agabrys commented Feb 8, 2016

Unfortunately I found a bug related with source map when using rhino - less.js #2044.

Fortunately I solve this problem ;-) You need to add compiler options:

--source-map=<source-file> --source-map-output-map-file=<source-map-full-path>

example:

File source = new File("/root/src/main/less/basic.less");
LessCompiler compiler = new LessCompilerImpl();
String[] arguments = {
    "--source-map=basic.less",
    "--source-map-output-map-file=/root/target/basic.css.map"
};
String code = compiler.compile(source, new CompilerOptions(Arrays.asList(arguments)));
FileUtils.write(new File("/root/target/basic.css"), code);

Probably I will rewrite lesscss-compiler to be more source map friendly and next apply those changes to this library.

@agabrys
Copy link
Contributor

agabrys commented Feb 16, 2016

New API will be implemented in:
lesscss-compiler 2.0
lesscss-extended-compiler 3.0
lesscss-maven-plugin 2.0

@agabrys
Copy link
Contributor

agabrys commented Apr 12, 2016

Blocked by lesscss-compiler #3.

@agabrys
Copy link
Contributor

agabrys commented Feb 5, 2017

Today I started working on Less Compiler 2.0.0. It will handle Source Maps. This library will be deprecated after release of Less Compiler 2.0.0, so I marked this bug as "Won't fix".

See:

@agabrys agabrys closed this as completed Feb 5, 2017
@agabrys agabrys added the wontfix label Feb 5, 2017
@agabrys agabrys self-assigned this Feb 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants