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
File renamed without changes.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": ["./changelog-generator.mjs", { "repo": "webpack/sass-loader" }],
"changelog": ["./changelog-generator.js", { "repo": "webpack/sass-loader" }],
"fixed": [],
"linked": [],
"access": "public",
Expand Down
8 changes: 8 additions & 0 deletions .changeset/esm-conversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"sass-loader": major
---

Convert source to native ECMAScript modules. The package now declares
`"type": "module"` and exposes both an ESM and a CommonJS build via the
`exports` field. CommonJS consumers continue to work via `require`, and
ESM consumers can now `import` the loader directly.
30 changes: 30 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const MIN_BABEL_VERSION = 7;

export default (api) => {
api.assertVersion(MIN_BABEL_VERSION);

const env = api.env();
const isCjs = env === "cjs";

return {
presets: [
[
"@babel/preset-env",
{
targets: { node: "22.11.0" },
modules: false,
},
],
],
plugins: isCjs
? [
[
"@babel/plugin-transform-modules-commonjs",
{
ignoreDynamicImport: true,
},
],
]
: [],
};
};
8 changes: 8 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "eslint/config";
import configs from "eslint-config-webpack/configs.js";

export default defineConfig([
{
extends: [configs["node-recommended"]],
},
]);
15 changes: 0 additions & 15 deletions eslint.config.mjs

This file was deleted.

4 changes: 1 addition & 3 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"use strict";

module.exports = {
export default {
"*": [
"prettier --cache --write --ignore-unknown",
"cspell --cache --no-must-find-files",
Expand Down
Loading
Loading