Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute paths in sourcemaps #80

Closed
pedrosland opened this issue Mar 7, 2016 · 3 comments
Closed

Absolute paths in sourcemaps #80

pedrosland opened this issue Mar 7, 2016 · 3 comments

Comments

@pedrosland
Copy link

I am trying to get the absolute path to @imported less files to display in my sourcemap.

There is a config parameter output.devtoolmodulefilenametemplate to control this but it doesn't work for less files. It does for JS files.

I've been trying to debug this myself and for convenience I'm using this in my webpack config file:

        devtoolModuleFilenameTemplate: function(info){
          console.log('absoluteResourcePath', info.absoluteResourcePath);
          return info.absoluteResourcePath;
        }

I disabled the rewriting of the source map in less-loader in the less.render callback. This allowed me to get some directory structure and for Chrome to differentiate between 'buttons.less' and 'mixins/buttons.less':

webpack:///node_modules/bootstrap/less/mixins/buttons.less

Unfortunately this is still not an absolute path. Less produces an absolute path in its sourcemaps. I've managed to track down that module is a string in ModuleFilenameHelpers.createFilename and so this information is not available.

@jhnns
Copy link
Member

jhnns commented Mar 25, 2016

Does [email protected] (#73) fix this issue?

@jhnns
Copy link
Member

jhnns commented Mar 25, 2016

Also possible duplicate of #83

@jhnns
Copy link
Member

jhnns commented Mar 20, 2017

Starting with less-loader 4, source maps contain absolute paths now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants