@expo/metro-config 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,7 +43,7 @@ async function transformCssModuleWeb(props) {
|
|
|
43
43
|
reactNativeWeb,
|
|
44
44
|
variables
|
|
45
45
|
} = convertLightningCssToReactNativeWebStyleSheet(cssResults.exports);
|
|
46
|
-
let outputModule = `module.exports=Object.assign(${JSON.stringify(styles)},{unstable_styles:${JSON.stringify(reactNativeWeb)}}
|
|
46
|
+
let outputModule = `module.exports=Object.assign(${JSON.stringify(styles)},{unstable_styles:${JSON.stringify(reactNativeWeb)}},${JSON.stringify(variables)});`;
|
|
47
47
|
if (props.options.dev) {
|
|
48
48
|
const runtimeCss = (0, _css().wrapDevelopmentCSS)({
|
|
49
49
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-modules.js","names":["_css","data","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","RNW_CSS_CLASS_ID","transformCssModuleWeb","props","transform","Promise","resolve","then","cssResults","filename","code","Buffer","from","src","sourceMap","options","cssModules","dashedIdents","projectRoot","minify","codeAsString","toString","styles","reactNativeWeb","variables","convertLightningCssToReactNativeWebStyleSheet","exports","outputModule","JSON","stringify","dev","runtimeCss","wrapDevelopmentCSS","output","css","map","input","entries","value","className","name","composes","length","join","startsWith","$$css","matchCssModule","filePath","test"],"sources":["../../src/transform-worker/css-modules.ts"],"sourcesContent":["import { wrapDevelopmentCSS } from './css';\n\nconst RNW_CSS_CLASS_ID = '_';\n\nexport async function transformCssModuleWeb(props: {\n filename: string;\n src: string;\n options: { projectRoot: string; minify: boolean; dev: boolean; sourceMap: boolean };\n}) {\n const { transform } = await import('lightningcss');\n\n // TODO: Add bundling to resolve imports\n // https://lightningcss.dev/bundling.html#bundling-order\n\n const cssResults = transform({\n filename: props.filename,\n code: Buffer.from(props.src),\n sourceMap: props.options.sourceMap,\n cssModules: {\n // Prevent renaming CSS variables to ensure\n // variables created in global files are available.\n dashedIdents: false,\n },\n // cssModules: true,\n projectRoot: props.options.projectRoot,\n minify: props.options.minify,\n });\n const codeAsString = cssResults.code.toString();\n\n const { styles, reactNativeWeb, variables } = convertLightningCssToReactNativeWebStyleSheet(\n cssResults.exports!\n );\n\n let outputModule = `module.exports=Object.assign(${JSON.stringify(\n styles\n )},{unstable_styles:${JSON.stringify(reactNativeWeb)}}
|
|
1
|
+
{"version":3,"file":"css-modules.js","names":["_css","data","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","RNW_CSS_CLASS_ID","transformCssModuleWeb","props","transform","Promise","resolve","then","cssResults","filename","code","Buffer","from","src","sourceMap","options","cssModules","dashedIdents","projectRoot","minify","codeAsString","toString","styles","reactNativeWeb","variables","convertLightningCssToReactNativeWebStyleSheet","exports","outputModule","JSON","stringify","dev","runtimeCss","wrapDevelopmentCSS","output","css","map","input","entries","value","className","name","composes","length","join","startsWith","$$css","matchCssModule","filePath","test"],"sources":["../../src/transform-worker/css-modules.ts"],"sourcesContent":["import { wrapDevelopmentCSS } from './css';\n\nconst RNW_CSS_CLASS_ID = '_';\n\nexport async function transformCssModuleWeb(props: {\n filename: string;\n src: string;\n options: { projectRoot: string; minify: boolean; dev: boolean; sourceMap: boolean };\n}) {\n const { transform } = await import('lightningcss');\n\n // TODO: Add bundling to resolve imports\n // https://lightningcss.dev/bundling.html#bundling-order\n\n const cssResults = transform({\n filename: props.filename,\n code: Buffer.from(props.src),\n sourceMap: props.options.sourceMap,\n cssModules: {\n // Prevent renaming CSS variables to ensure\n // variables created in global files are available.\n dashedIdents: false,\n },\n // cssModules: true,\n projectRoot: props.options.projectRoot,\n minify: props.options.minify,\n });\n const codeAsString = cssResults.code.toString();\n\n const { styles, reactNativeWeb, variables } = convertLightningCssToReactNativeWebStyleSheet(\n cssResults.exports!\n );\n\n let outputModule = `module.exports=Object.assign(${JSON.stringify(\n styles\n )},{unstable_styles:${JSON.stringify(reactNativeWeb)}},${JSON.stringify(variables)});`;\n\n if (props.options.dev) {\n const runtimeCss = wrapDevelopmentCSS({\n ...props,\n src: codeAsString,\n });\n\n outputModule += '\\n' + runtimeCss;\n }\n\n return {\n output: outputModule,\n css: cssResults.code,\n map: cssResults.map,\n };\n}\n\nexport function convertLightningCssToReactNativeWebStyleSheet(\n input: import('lightningcss').CSSModuleExports\n) {\n const styles: Record<string, string> = {};\n const reactNativeWeb: Record<string, any> = {};\n const variables: Record<string, string> = {};\n // e.g. { container: { name: 'ahs8IW_container', composes: [], isReferenced: false }, }\n Object.entries(input).map(([key, value]) => {\n // order matters here\n let className = value.name;\n\n if (value.composes.length) {\n className += ' ' + value.composes.map((value) => value.name).join(' ');\n }\n\n // CSS Variables will be `{string: string}`\n if (key.startsWith('--')) {\n variables[key] = className;\n }\n\n styles[key] = className;\n reactNativeWeb[key] = { $$css: true, [RNW_CSS_CLASS_ID]: className };\n return {\n [key]: { $$css: true, [RNW_CSS_CLASS_ID]: className },\n };\n });\n\n return { styles, reactNativeWeb, variables };\n}\n\nexport function matchCssModule(filePath: string): boolean {\n return !!/\\.module(\\.(native|ios|android|web))?\\.(css|s[ac]ss)$/.test(filePath);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,O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K,CAAC,CAACD,GAAG,CAAC,CAAC,CAACxC,GAAG,EAAE2C,KAAK,CAAC,KAAK;IAC1C;IACA,IAAIC,SAAS,GAAGD,KAAK,CAACE,IAAI;IAE1B,IAAIF,KAAK,CAACG,QAAQ,CAACC,MAAM,EAAE;MACzBH,SAAS,IAAI,GAAG,GAAGD,KAAK,CAACG,QAAQ,CAACN,GAAG,CAAEG,KAAK,IAAKA,KAAK,CAACE,IAAI,CAAC,CAACG,IAAI,CAAC,GAAG,CAAC;IACxE;;IAEA;IACA,IAAIhD,GAAG,CAACiD,UAAU,CAAC,IAAI,CAAC,EAAE;MACxBpB,SAAS,CAAC7B,GAAG,CAAC,GAAG4C,SAAS;IAC5B;IAEAjB,MAAM,CAAC3B,GAAG,CAAC,GAAG4C,SAAS;IACvBhB,cAAc,CAAC5B,GAAG,CAAC,GAAG;MAAEkD,KAAK,EAAE,IAAI;MAAE,CAAC5C,gBAAgB,GAAGsC;IAAU,CAAC;IACpE,OAAO;MACL,CAAC5C,GAAG,GAAG;QAAEkD,KAAK,EAAE,IAAI;QAAE,CAAC5C,gBAAgB,GAAGsC;MAAU;IACtD,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IAAEjB,MAAM;IAAEC,cAAc;IAAEC;EAAU,CAAC;AAC9C;AAEO,SAASsB,cAAcA,CAACC,QAAgB,EAAW;EACxD,OAAO,CAAC,CAAC,uDAAuD,CAACC,IAAI,CAACD,QAAQ,CAAC;AACjF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/metro-config",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "A Metro config for running React Native projects with the Metro bundler",
|
|
5
5
|
"main": "build/ExpoMetroConfig.js",
|
|
6
6
|
"scripts": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "aa6bda733cef821234c77a19bbe6008b72c1c594"
|
|
54
54
|
}
|