Skip to content

Commit 5b4baea

Browse files
committed
Use path.resolve instead of string concatenation
This allows the path to be statically analysed when bundling, for example with `pkg`
1 parent ee0f329 commit 5b4baea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/corePlugins.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fs from 'fs'
2+
import path from 'path'
23
import postcss from 'postcss'
34
import createUtilityPlugin from './util/createUtilityPlugin'
45
import buildMediaQuery from './util/buildMediaQuery'
@@ -363,7 +364,9 @@ export let variantPlugins = {
363364

364365
export let corePlugins = {
365366
preflight: ({ addBase }) => {
366-
let preflightStyles = postcss.parse(fs.readFileSync(`${__dirname}/css/preflight.css`, 'utf8'))
367+
let preflightStyles = postcss.parse(
368+
fs.readFileSync(path.resolve(__dirname, 'css/preflight.css'), 'utf8')
369+
)
367370

368371
addBase([
369372
postcss.comment({

0 commit comments

Comments
 (0)