Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 0 additions & 173 deletions lib/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,176 +40,3 @@ export const TRUE = sass.TRUE;
export const FALSE = sass.FALSE;
export const NULL = sass.NULL;
export const types = sass.types;

let printedDefaultExportDeprecation = false;
function defaultExportDeprecation() {
if (printedDefaultExportDeprecation) return;
printedDefaultExportDeprecation = true;
console.error(
"`import sass from 'sass'` is deprecated.\n" +
"Please use `import * as sass from 'sass'` instead.",
);
}

export default {
get compile() {
defaultExportDeprecation();
return sass.compile;
},
get compileAsync() {
defaultExportDeprecation();
return sass.compileAsync;
},
get compileString() {
defaultExportDeprecation();
return sass.compileString;
},
get compileStringAsync() {
defaultExportDeprecation();
return sass.compileStringAsync;
},
get NodePackageImporter() {
defaultExportDeprecation();
return sass.NodePackageImporter;
},
get initAsyncCompiler() {
defaultExportDeprecation();
return sass.initAsyncCompiler;
},
get initCompiler() {
defaultExportDeprecation();
return sass.initCompiler;
},
get AsyncCompiler() {
defaultExportDeprecation();
return sass.AsyncCompiler;
},
get Compiler() {
defaultExportDeprecation();
return sass.Compiler;
},
get deprecations() {
defaultExportDeprecation();
return sass.deprecations;
},
get Version() {
defaultExportDeprecation();
return sass.Version;
},
get Logger() {
defaultExportDeprecation();
return sass.Logger;
},
get CalculationOperation() {
defaultExportDeprecation();
return sass.CalculationOperation;
},
get CalculationOperator() {
defaultExportDeprecation();
return sass.CalculationOperator;
},
get CalculationInterpolation() {
defaultExportDeprecation();
return sass.CalculationInterpolation;
},
get SassArgumentList() {
defaultExportDeprecation();
return sass.SassArgumentList;
},
get SassBoolean() {
defaultExportDeprecation();
return sass.SassBoolean;
},
get SassCalculation() {
defaultExportDeprecation();
return sass.SassCalculation;
},
get SassColor() {
defaultExportDeprecation();
return sass.SassColor;
},
get SassFunction() {
defaultExportDeprecation();
return sass.SassFunction;
},
get SassMixin() {
defaultExportDeprecation();
return sass.SassMixin;
},
get SassList() {
defaultExportDeprecation();
return sass.SassList;
},
get SassMap() {
defaultExportDeprecation();
return sass.SassMap;
},
get SassNumber() {
defaultExportDeprecation();
return sass.SassNumber;
},
get SassString() {
defaultExportDeprecation();
return sass.SassString;
},
get Value() {
defaultExportDeprecation();
return sass.Value;
},
get CustomFunction() {
defaultExportDeprecation();
return sass.CustomFunction;
},
get ListSeparator() {
defaultExportDeprecation();
return sass.ListSeparator;
},
get sassFalse() {
defaultExportDeprecation();
return sass.sassFalse;
},
get sassNull() {
defaultExportDeprecation();
return sass.sassNull;
},
get sassTrue() {
defaultExportDeprecation();
return sass.sassTrue;
},
get Exception() {
defaultExportDeprecation();
return sass.Exception;
},
get PromiseOr() {
defaultExportDeprecation();
return sass.PromiseOr;
},
get info() {
defaultExportDeprecation();
return sass.info;
},
get render() {
defaultExportDeprecation();
return sass.render;
},
get renderSync() {
defaultExportDeprecation();
return sass.renderSync;
},
get TRUE() {
defaultExportDeprecation();
return sass.TRUE;
},
get FALSE() {
defaultExportDeprecation();
return sass.FALSE;
},
get NULL() {
defaultExportDeprecation();
return sass.NULL;
},
get types() {
defaultExportDeprecation();
return sass.types;
},
};
6 changes: 0 additions & 6 deletions test/after-compile-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,4 @@ for (const [name, value] of Object.entries(cjs)) {
} else if (esm[name] !== value) {
throw new Error(`ESM ${name} isn't the same as CJS.`);
}

if (!esm.default[name]) {
throw new Error(`ESM default export is missing export ${name}.`);
} else if (esm.default[name] !== value) {
throw new Error(`ESM default export ${name} isn't the same as CJS.`);
}
}