Closed Hotell closed 7 months ago
@Hotell indeed, currently both @griffel/babel-preset
& @griffel/webpack-loader
use Linaria v3. Linaria v3 does not support .mjs
and will not as it's EOL. The longterm plan is to drop @griffel/babel-preset
and have only bundler plugins i.e. @griffel/webpack-loader
, etc.
I created a POC using @wyw-in-js/transform
(https://github.com/microsoft/fluentui/pull/30992), once it will have proper resolver configured it should have .mjs
extensions.
FYI I improved error reporting for current tooling, so errors won't be so cryptic anymore, https://github.com/microsoft/griffel/pull/522.
if package A imports from package B, where B ships native ESM via exports map (
exports#import
) , where those files have.mjs
extension and all relative imports use.mjs
, babel processing fails.Stack trace
it explodes on https://github.com/microsoft/griffel/blob/main/packages/babel-preset/src/utils/evaluatePathsInVM.ts#L106
while invoking babel
valueToNode
function , loggingvalue
arg throws following:original error
Repro
yarn lage build --to react-divider
yarn workspace @fluentui/react-divider babel ./lib/components/Divider/useDividerStyles.styles.js
for raw babel error stack trace