mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-06 02:10:08 +08:00
This time (following the admin move) - select-kit, float-kit, truth-helpers, and dialog-holder --------- Co-authored-by: David Taylor <david@taylorhq.com>
16 lines
516 B
JavaScript
16 lines
516 B
JavaScript
// https://astexplorer.net/#/gist/14696755417f9d41c8c2bd72c187b0da/41a903d14d860270fa4eefab69c8ae8934971cdc
|
|
export default function ({ types: t }) {
|
|
return {
|
|
visitor: {
|
|
ImportDeclaration(path) {
|
|
const moduleName = path.node.source.value;
|
|
if (
|
|
/^(admin|select-kit|float-kit|dialog-holder)\//.test(moduleName) ||
|
|
moduleName.startsWith("truth-helpers")
|
|
) {
|
|
path.node.source = t.stringLiteral(`discourse/${moduleName}`);
|
|
}
|
|
},
|
|
},
|
|
};
|
|
}
|