Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Sep 18, 2024
1 parent b69fe00 commit 44b6ede
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { expect, test } from 'vitest'
import { findAssetFile, isBuild } from '~utils'

test.runIf(isBuild)('sass modern compiler build multiple entries', () => {
expect(findAssetFile(/entry1/, 'sass-modern-compiler-build'))
.toMatchInlineSnapshot(`
".entry1{color:red}
"
`)
expect(findAssetFile(/entry2/, 'sass-modern-compiler-build'))
.toMatchInlineSnapshot(`
".entry2{color:#00f}
"
`)
})
3 changes: 3 additions & 0 deletions playground/css/sass-modern-compiler-build/entry1.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.entry1 {
color: red;
}
3 changes: 3 additions & 0 deletions playground/css/sass-modern-compiler-build/entry2.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.entry2 {
color: blue;
}
27 changes: 27 additions & 0 deletions playground/css/vite.config-sass-modern-compiler-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import path from 'node:path'
import { defineConfig } from 'vite'

export default defineConfig({
build: {
outDir: 'dist/sass-modern-compiler-build',
rollupOptions: {
input: {
entry1: path.join(
import.meta.dirname,
'sass-modern-compiler-build/entry1.scss',
),
entry2: path.join(
import.meta.dirname,
'sass-modern-compiler-build/entry2.scss',
),
},
},
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
})

0 comments on commit 44b6ede

Please sign in to comment.