Skip to content

Commit

Permalink
[Fix] Support import-lazy bundler format (#6449)
Browse files Browse the repository at this point in the history
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
  • Loading branch information
phoenisx and ybiquitous committed Nov 4, 2022
1 parent 1a63e71 commit 2724aa4
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 259 deletions.
5 changes: 5 additions & 0 deletions .changeset/poor-monkeys-begin.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: usage of the `import-lazy` package to fit bundlers
18 changes: 8 additions & 10 deletions lib/formatters/index.js
@@ -1,18 +1,16 @@
'use strict';

const _importLazy = require('import-lazy');

const importLazy = _importLazy(require);
const importLazy = require('import-lazy');

/** @type {typeof import('stylelint').formatters} */
const formatters = {
compact: importLazy('./compactFormatter'),
github: importLazy('./githubFormatter'),
json: importLazy('./jsonFormatter'),
string: importLazy('./stringFormatter'),
tap: importLazy('./tapFormatter'),
unix: importLazy('./unixFormatter'),
verbose: importLazy('./verboseFormatter'),
compact: importLazy(() => require('./compactFormatter'))(),
github: importLazy(() => require('./githubFormatter'))(),
json: importLazy(() => require('./jsonFormatter'))(),
string: importLazy(() => require('./stringFormatter'))(),
tap: importLazy(() => require('./tapFormatter'))(),
unix: importLazy(() => require('./unixFormatter'))(),
verbose: importLazy(() => require('./verboseFormatter'))(),
};

module.exports = formatters;

0 comments on commit 2724aa4

Please sign in to comment.