add scope

This commit is contained in:
Andrew Pareles 2024-11-11 03:04:48 -08:00
parent 1112f79cf5
commit 06819e172a
3 changed files with 7 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import { execSync } from 'child_process';
// tsup to build all react to out/
execSync('npx scope-tailwind ./sidebar-tsx -c styles.css')
execSync('npx scope-tailwind ./src -o src2/ -s void-scope -c styles.css')
// build tailwind -> styles.css
execSync('tsup')

View file

@ -16,7 +16,7 @@ const Sidebar = () => {
const { isHistoryOpen, currentTab: tab } = sidebarState
useEffect(() => { sidebarStateService.onDidChangeState(() => setSideBarState(sidebarStateService.state)) }, [sidebarStateService])
return <>
return <div className='@@void-scope'>
<div className={`flex flex-col h-screen w-full`}>
<span onClick={() => {
@ -38,7 +38,7 @@ const Sidebar = () => {
</div>
</div>
</>
</div>
}

View file

@ -2,7 +2,7 @@ import { defineConfig } from 'tsup'
export default defineConfig({
entry: [
'./sidebar-tsx/Sidebar.tsx'
'./src2/sidebar-tsx/Sidebar.tsx'
],
outDir: './out',
format: ['esm'],
@ -21,4 +21,7 @@ export default defineConfig({
.replaceAll('*', '.*'))
],
treeshake: true,
esbuildOptions(options) {
options.outbase = 'out' // This tells esbuild to use src2 as the base for output paths
}
})