GithubHelp home page GithubHelp logo

Comments (7)

IceCreamYou avatar IceCreamYou commented on May 26, 2024 3

I think that dart-sass does not support relative files in the sources field as of sass/dart-sass#1021 when it's not writing the files to disk. I'm not sure why that change was made. The official sass API documentation also says:

The source map uses absolute file: URLs to link to the Sass source files, except if the source file comes from the data option in which case it lists its URL as stdin.

I haven't yet figured out if there's a way around this.

from grunt-sass.

petertwise avatar petertwise commented on May 26, 2024 1

This feels like a totally crazy hack approach that should not be necessary, but for now, I'm using grunt-string-replace to get this done:

'string-replace': {
	dist: {
		files: [
			{
				expand: true,
				cwd: 'dist/css/',
				src: '*.min.css.map',
				dest: 'dist/css/',
			},
		],
		options: {
			replacements: [
				// place files inline example
				{
					pattern: /(file:\/\/\/([^,]*)\/wp-content)+/g,
					replacement: '/wp-content',
				},
			],
		},
	},
},

from grunt-sass.

 avatar commented on May 26, 2024

Is this repo still maintained? I don't think it can be answered in one of the Sass-parser repo's since it's the specific implementation of grunt-sass that seems to cause this issue.

from grunt-sass.

petertwise avatar petertwise commented on May 26, 2024

Not sure there's much to be done here as node-sass is basically telling people to use dart-sass for continued support and you're right that it looks like they are forcing stdout to use absolute urls.

Just reemphasizing that this is sad since the default for sass --source-map-urls is relative in dart-sass and this issue means that each time a new developer works on any of our projects and any css compiling is triggered, they are checking in their new absolute URLs from their local machine for every single map file.

from grunt-sass.

timint avatar timint commented on May 26, 2024

I just migrated to dart-sass and discovered all sourcemap paths are now absolute instead of relative. Passing "source-map-urls" = "relative" or sourceMapUrls = "relative" under options has no effect. Anyone find a solution?

from grunt-sass.

kgiglia avatar kgiglia commented on May 26, 2024

We're also having this issue, would love to know if there has been any movement.

from grunt-sass.

petertwise avatar petertwise commented on May 26, 2024

What about this approach? - using sourceMapContents to make bigger but more dependable map files? Is that possible here, or still not possible because we're using the API and not command line?

cferdinandi/build-tool-boilerplate#7 (comment)

from grunt-sass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.