mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 10:48:44 +00:00
Make module types explicit and convert some to ESM (#15964)
This commit is contained in:
24
build-scripts/rollup-plugins/ignore-plugin.cjs
Normal file
24
build-scripts/rollup-plugins/ignore-plugin.cjs
Normal file
@@ -0,0 +1,24 @@
|
||||
module.exports = function (userOptions = {}) {
|
||||
// Files need to be absolute paths.
|
||||
// This only works if the file has no exports
|
||||
// and only is imported for its side effects
|
||||
const files = userOptions.files || [];
|
||||
|
||||
if (files.length === 0) {
|
||||
return {
|
||||
name: "ignore",
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "ignore",
|
||||
|
||||
load(id) {
|
||||
return files.some((toIgnorePath) => id.startsWith(toIgnorePath))
|
||||
? {
|
||||
code: "",
|
||||
}
|
||||
: null;
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user