MCPcopy Create free account
hub / github.com/callstack/linaria / getLinariaConfig

Function getLinariaConfig

packages/testkit/src/babel.test.ts:68–109  ·  view source on GitHub ↗
(
  evaluator: Evaluator,
  linariaConfig: PartialOptions,
  stage?: Stage
)

Source from the content-addressed store, hash-verified

66const cachesForCleanup = new Set<TransformCacheCollection>();
67
68const getLinariaConfig = (
69 evaluator: Evaluator,
70 linariaConfig: PartialOptions,
71 stage?: Stage
72): PluginOptions => {
73 const { features: customFeatures, ...restConfig } = linariaConfig;
74
75 return loadWywOptions({
76 extensions: [
77 '.cjs',
78 '.cts',
79 '.js',
80 '.jsx',
81 '.mjs',
82 '.mts',
83 '.ts',
84 '.tsx',
85 '.json',
86 ],
87 displayName: true,
88 rules: [
89 {
90 action: evaluator,
91 },
92 {
93 test: /[\\/]node_modules[\\/](?!@linaria)/,
94 action: 'ignore',
95 },
96 {
97 test: /\.json$/,
98 action: 'ignore',
99 },
100 ],
101 features: {
102 ...customFeatures,
103 happyDOM: false,
104 softErrors: false,
105 },
106 stage,
107 ...restConfig,
108 });
109};
110
111async function transform(
112 originalCode: string,

Callers 1

transformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…