rollup-plugin-react-scoped-css
Version:
A rollup plugin designed to allow scoped css to be run in react (Compatible with vite and rollup)
18 lines (17 loc) • 628 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getImportDeclarationsValue = void 0;
const ast_iterator_1 = require("../ast-iterator");
const ast_utils_1 = require("../ast.utils");
const getImportDeclarationsValue = (root) => {
const urls = [];
for (const node of (0, ast_iterator_1.astIterator)(root)) {
if (!(0, ast_utils_1.isNodeImportOrRequire)(node)) {
continue;
}
const src = (0, ast_utils_1.getSrcFromImportOrRequire)(node);
urls.push(src);
}
return urls;
};
exports.getImportDeclarationsValue = getImportDeclarationsValue;