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

Enable/disable node-sass sourcemaps #903

Closed
lehroj opened this issue Feb 27, 2018 · 9 comments
Closed

Enable/disable node-sass sourcemaps #903

lehroj opened this issue Feb 27, 2018 · 9 comments
Labels

Comments

@lehroj
Copy link

lehroj commented Feb 27, 2018

👋

Is there a way to add sourcemaps support for node-sass ?

Only way i've found is to create a .sassrc with this config (inline-sourcemaps here) for example:

{
  "sourceMap": true,
  "sourceMapEmbed": true
}

But no way to disable it when running parcel buildcommand.

Thanks for your work.

@devongovett
Copy link
Member

This is really a feature request for CSS source maps. We should enable/disable them based on the CLI flag for sourcemaps that is already used for JS.

@zoubingwu
Copy link

zoubingwu commented Feb 28, 2018

@devongovett hey is cli flags still available to disable then sourcemap?
I just installed the latest 1.6.2 version and found it shows unknown option: --no-source-maps when trying to disable it.

screen shot 2018-02-28 at 19 33 30

// package.json
...
"scripts": {
    "start": "parcel index.html --open",
    "build": "parcel build index.html --no-source-maps"
  },
"devDependencies": {
    "parcel-bundler": "^1.6.2",
    "typescript": "^2.7.2"
  },
  "dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0"
  }
...

both local and global are 1.6.2 version.

there is also no such option in help infos when I typed parce build -h in terminal, other flag works well tho.
screen shot 2018-02-28 at 19 32 12

@DeMoorJasper
Copy link
Member

@shadeofgod the build sourcemaps haven't been released yet, they are only on the current master branch of the github repo

@zoubingwu
Copy link

@DeMoorJasper this is a little bit weird, it do generated sourcemaps at the first time when I ran build command, later after I posted here I removed whole local node_modules directory and npm install everything again, oops no more sourcemaps for the build this time.

btw docs says it was enabled by default tho.

@DeMoorJasper
Copy link
Member

@shadeofgod The docs is my bad, it should've said is enabled by default in watch mode, as it's not been released yet on build as I said before.
In the next release it will however be enabled by default in production, the sourcemaps inside your output folder is probably from the watch command? As they probably use the same output directory, otherwise this would be very weird or u were using the github version.

@zoubingwu
Copy link

zoubingwu commented Feb 28, 2018

@DeMoorJasper yeah you are right, I found it. It was generated by that npm start command. And build command won't remove all the files at first in dist/ directory(seems it simply replaces content with same file name) and the sourcemaps file just stays there all the time so I thought it was from production mode.

thanks for your quick response!

oligot added a commit to oligot/parcel that referenced this issue May 16, 2018
Enable/disable sourcemaps based on the CLI flag for sourcemaps that is already
used for JS.

Note that sass test are failing for now, and I don't really understand why.
If someone with a deeper understanding of the Parcel code base could take a
look and see what's wrong, this would help me a lot !
@oligot
Copy link

oligot commented May 16, 2018

I've opened a PR to implement this feature: #1373

Note that sass test are failing for now, and I don't really understand why.
If someone with a deeper understanding of the Parcel code base than me could take a look and see what's wrong, this would help me a lot !

@Glinkis
Copy link
Contributor

Glinkis commented Sep 9, 2018

Sass source maps are not working for me.
I have created a .sassrc file with the proper config, but I get to source mapping whatsoever.

@devongovett devongovett added the CSS Preprocessing All the PostCSS, Less, SASS, etc issues label Jan 6, 2019
@devongovett
Copy link
Member

PR coming along for this in #2489

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

No branches or pull requests

6 participants