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

Incorrect source map with SASS (and Windows) ? #124

Open
mistic100 opened this issue Sep 17, 2018 · 0 comments
Open

Incorrect source map with SASS (and Windows) ? #124

mistic100 opened this issue Sep 17, 2018 · 0 comments

Comments

@mistic100
Copy link

mistic100 commented Sep 17, 2018

Hello,

There seems to be a problem when using this plugin with SASS loader

For this issue you can check the simple repro I created here https://github.com/mistic100/fluffy-octo-sniffle

The generated map is :

{
  "version": 3,
  "sources": [
    "dist\\main.scss"
  ],
  "names": [],
  "mappings": "AAAA;EACE,gBAAgB,EAAE",
  "file": "dist/index.css",
  "sourcesContent": [
    "body {\n  background: red; }\n"
  ]
}

The problems here are :

  1. The "sources" is invalid, it does not reference the source files but a non-existent file
  2. The "file" is invalid, it should be "index.css" without "dist/"
  3. The "mappings" are not the one you'll get but running node-sass manually
  4. There is apparently no reason "sourcesContent" is here

If you uncomment line 17 of rollup.config.js to configure the sassLoader with outFile : 'dist/index.css' the output is now :

{
  "version": 3,
  "sources": [
    "src\\scss\\main.scss",
    "src\\scss\\_vars.scss",
    "dist\\main.scss"
  ],
  "names": [],
  "mappings": "AAEA;EACE,gBCHS,EDIV;;AEDD,qCAAqC",
  "file": "dist/index.css"
}
  1. The "mappings" are correct
  2. The "file" is still wrong
  3. The "sources" is a mixed version of the real source the same non-existent file
  4. The "sources" should start with "../"
  5. The "sources" use Windows path separators !!! (I am on Windows of course)

I hope I am being explict on the issue, please let me know if you need more info.

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

1 participant