mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 05:41:14 +01:00
Rename the npm package "sass".
We'll continue to build the "dart-sass" package for the time being to ease migration, but I expect to move entirely to "sass" by 1.0.0 stable.
This commit is contained in:
parent
54d4f3f608
commit
bd4cc36186
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "dart-sass",
|
||||
"name": "sass",
|
||||
"description": "A Dart implementation of Sass, compiled to JS.",
|
||||
"license": "MIT",
|
||||
"bugs": "https://github.com/sass/dart-sass/issues",
|
||||
|
@ -71,13 +71,22 @@ js() {
|
||||
@Task('Build a pure-JS npm package.')
|
||||
@Depends(js)
|
||||
npm_package() {
|
||||
var dir = new Directory('build/npm');
|
||||
var json = JSON.decode(new File('package/package.json').readAsStringSync());
|
||||
json['version'] = _version;
|
||||
|
||||
_writeNpmPackage('build/npm', json);
|
||||
_writeNpmPackage('build/npm-old', json..addAll({"name": "dart-sass"}));
|
||||
}
|
||||
|
||||
/// Writes a Dart Sass NPM package to the directory at [destination].
|
||||
///
|
||||
/// The [json] will be used as the package's package.json.
|
||||
void _writeNpmPackage(String destination, Map<String, dynamic> json) {
|
||||
var dir = new Directory(destination);
|
||||
if (dir.existsSync()) dir.deleteSync(recursive: true);
|
||||
dir.createSync(recursive: true);
|
||||
|
||||
log("copying package/package.json to build/npm");
|
||||
var json = JSON.decode(new File('package/package.json').readAsStringSync());
|
||||
json['version'] = _version;
|
||||
log("copying package/package.json to $destination");
|
||||
new File(p.join(dir.path, 'package.json'))
|
||||
.writeAsStringSync(JSON.encode(json));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user