1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 10:48:44 +00:00

Integrate compatibility into other entrypoints (#6029)

This commit is contained in:
Paulus Schoutsen
2020-05-25 10:36:22 -07:00
committed by GitHub
parent d73b3d77ea
commit 050cdf3783
13 changed files with 16 additions and 55 deletions

View File

@@ -14,32 +14,6 @@ module.exports = function (userOptions = {}) {
return {
name: "ignore",
resolveId(importee, importer) {
// Only use ignore to intercept imports that we don't control
// inside node_module dependencies.
if (
importee.endsWith("commonjsHelpers.js") ||
importee.endsWith("rollupPluginBabelHelpers.js") ||
importee.endsWith("?commonjs-proxy") ||
!importer ||
!importer.includes("/node_modules/")
) {
return null;
}
let fullPath;
try {
fullPath = importee.startsWith(".")
? path.resolve(importee, importer)
: require.resolve(importee);
} catch (err) {
console.error("Error in ignore plugin", { importee, importer }, err);
throw err;
}
return files.some((toIgnorePath) => fullPath.startsWith(toIgnorePath))
? fullPath
: null;
},
load(id) {
return files.some((toIgnorePath) => id.startsWith(toIgnorePath))