@tamagui/vite-plugin 1.0.1-beta.78 → 1.0.1-beta.79
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.
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +7 -0
- package/dist/jsx/plugin.js +1 -0
- package/dist/jsx/plugin.js.map +7 -0
- package/package.json +3 -3
package/dist/jsx/index.js
CHANGED
package/dist/jsx/plugin.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/plugin.ts"],
|
|
4
|
+
"sourcesContent": ["export const plugin = {}\n// fork from https://github.com/seek-oss/vanilla-extract/blob/master/packages/vite-plugin/src/index.ts\n\n// import path from 'path'\n\n// import outdent from 'outdent'\n// import type { Plugin, ResolvedConfig, ViteDevServer } from 'vite'\n// import { normalizePath } from 'vite'\n\n// const styleUpdateEvent = (fileId: string) => `tamagui-style-update:${fileId}`\n\n// interface Options {\n// identifiers?: IdentifierOption\n// esbuildOptions?: CompileOptions['esbuildOptions']\n// }\n// export function vanillaExtractPlugin({ identifiers, esbuildOptions }: Options = {}): Plugin {\n// let config: ResolvedConfig\n// let server: ViteDevServer\n// let postCssConfig: PostCSSConfigResult | null\n// const cssMap = new Map<string, string>()\n\n// let virtualExt: string\n// let packageName: string\n\n// const getAbsoluteVirtualFileId = (source: string) => normalizePath(path.join(config.root, source))\n\n// return {\n// name: 'tamagui',\n// enforce: 'pre',\n// configureServer(_server) {\n// server = _server\n// },\n// config(_userConfig, env) {\n// const include = env.command === 'serve' ? ['@tamagui/css/injectStyles'] : []\n\n// return {\n// optimizeDeps: { include },\n// ssr: {\n// external: ['@tamagui/css', '@tamagui/css/fileScope', '@tamagui/css/adapter'],\n// },\n// }\n// },\n// async configResolved(resolvedConfig) {\n// config = resolvedConfig\n// packageName = getPackageInfo(config.root).name\n\n// if (config.command === 'serve') {\n// postCssConfig = await resolvePostcssConfig(config)\n// }\n\n// virtualExt = `.vanilla.${config.command === 'serve' ? 'js' : 'css'}`\n// },\n// resolveId(source) {\n// if (!source.endsWith(virtualExt)) {\n// return\n// }\n\n// // Absolute paths seem to occur often in monorepos, where files are\n// // imported from outside the config root.\n// const absoluteId = source.startsWith(config.root) ? source : getAbsoluteVirtualFileId(source)\n\n// // There should always be an entry in the `cssMap` here.\n// // The only valid scenario for a missing one is if someone had written\n// // a file in their app using the .vanilla.js/.vanilla.css extension\n// if (cssMap.has(absoluteId)) {\n// return absoluteId\n// }\n// },\n// load(id) {\n// if (!cssMap.has(id)) {\n// return\n// }\n\n// const css = cssMap.get(id)\n\n// if (typeof css !== 'string') {\n// return\n// }\n\n// if (!server || server.config.isProduction) {\n// return css\n// }\n\n// return outdent`\n// import { injectStyles } from '@tamagui/css/injectStyles';\n\n// const inject = (css) => injectStyles({\n// fileScope: ${JSON.stringify({ filePath: id })},\n// css\n// });\n\n// inject(${JSON.stringify(css)});\n\n// import.meta.hot.on('${styleUpdateEvent(id)}', (css) => {\n// inject(css);\n// });\n// `\n// },\n// async transform(code, id, ssrParam) {\n// if (!cssFileFilter.test(id)) {\n// return null\n// }\n\n// let ssr: boolean | undefined\n\n// if (typeof ssrParam === 'boolean') {\n// ssr = ssrParam\n// } else {\n// ssr = ssrParam?.ssr\n// }\n\n// const index = id.indexOf('?')\n// const validId = index === -1 ? id : id.substring(0, index)\n\n// if (ssr) {\n// return addFileScope({\n// source: code,\n// filePath: normalizePath(validId),\n// rootPath: config.root,\n// packageName,\n// })\n// }\n\n// const { source, watchFiles } = await compile({\n// filePath: validId,\n// cwd: config.root,\n// esbuildOptions,\n// })\n\n// for (const file of watchFiles) {\n// // In start mode, we need to prevent the file from rewatching itself.\n// // If it's a `build --watch`, it needs to watch everything.\n// if (config.command === 'build' || file !== id) {\n// this.addWatchFile(file)\n// }\n// }\n\n// const output = await processVanillaFile({\n// source,\n// filePath: validId,\n// identOption: identifiers ?? (config.mode === 'production' ? 'short' : 'debug'),\n// serializeVirtualCssPath: async ({ fileScope, source }) => {\n// const rootRelativeId = `${fileScope.filePath}${virtualExt}`\n// const absoluteId = getAbsoluteVirtualFileId(rootRelativeId)\n\n// let cssSource = source\n\n// if (postCssConfig) {\n// const postCssResult = await (await import('postcss'))\n// .default(postCssConfig.plugins)\n// .process(source, {\n// ...postCssConfig.options,\n// from: undefined,\n// map: false,\n// })\n\n// cssSource = postCssResult.css\n// }\n\n// if (server && cssMap.has(absoluteId) && cssMap.get(absoluteId) !== source) {\n// const { moduleGraph } = server\n// const module = moduleGraph.getModuleById(absoluteId)\n\n// if (module) {\n// moduleGraph.invalidateModule(module)\n// }\n\n// server.ws.send({\n// type: 'custom',\n// event: styleUpdateEvent(absoluteId),\n// data: cssSource,\n// })\n// }\n\n// cssMap.set(absoluteId, cssSource)\n\n// // We use the root relative id here to ensure file contents (content-hashes)\n// // are consistent across build machines\n// return `import \"${rootRelativeId}\";`\n// },\n// })\n\n// return {\n// code: output,\n// map: { mappings: '' },\n// }\n// },\n// }\n// }\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,SAAS,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/vite-plugin",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.79",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tamagui/static": "^1.0.1-beta.
|
|
21
|
+
"@tamagui/static": "^1.0.1-beta.79",
|
|
22
22
|
"fs-extra": "^10.1.0",
|
|
23
23
|
"lodash": "^4.17.21"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
26
|
+
"@tamagui/build": "^1.0.1-beta.79"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|