-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not use
process.env.NODE_ENV
to detect production environment — …
…instead use import condition
- Loading branch information
Showing
7 changed files
with
19 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'gatsby-plugin-twind': minor | ||
'@twind/with-next': minor | ||
'@twind/with-remix': minor | ||
'@twind/with-sveltekit': minor | ||
--- | ||
|
||
do not use `process.env.NODE_ENV` to detect production environment — instead use import condition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1 @@ | ||
import type { | ||
Twind, | ||
BaseTheme, | ||
TwindConfig, | ||
TwindUserConfig, | ||
Preset, | ||
ExtractThemes, | ||
} from '@twind/core' | ||
|
||
import { install as install$ } from '@twind/core' | ||
|
||
export default install | ||
|
||
function install<Theme extends BaseTheme = BaseTheme>( | ||
config: TwindConfig<Theme>, | ||
): Twind<Theme & BaseTheme> | ||
|
||
function install<Theme = BaseTheme, Presets extends Preset<any>[] = Preset[]>( | ||
config: TwindUserConfig<Theme, Presets>, | ||
): Twind<BaseTheme & ExtractThemes<Theme, Presets>> | ||
|
||
function install(config: TwindConfig | TwindUserConfig): Twind { | ||
return install$(config as TwindConfig, process.env.NODE_ENV == 'production') | ||
} | ||
export { install as default } from '@twind/core' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1 @@ | ||
import type { | ||
Twind, | ||
BaseTheme, | ||
TwindConfig, | ||
TwindUserConfig, | ||
Preset, | ||
ExtractThemes, | ||
} from '@twind/core' | ||
|
||
import { install as install$ } from '@twind/core' | ||
|
||
export default install | ||
|
||
function install<Theme extends BaseTheme = BaseTheme>( | ||
config: TwindConfig<Theme>, | ||
isProduction?: boolean, | ||
): Twind<Theme & BaseTheme> | ||
|
||
function install<Theme = BaseTheme, Presets extends Preset<any>[] = Preset[]>( | ||
config: TwindUserConfig<Theme, Presets>, | ||
isProduction?: boolean, | ||
): Twind<BaseTheme & ExtractThemes<Theme, Presets>> | ||
|
||
function install( | ||
config: TwindConfig | TwindUserConfig, | ||
isProduction = process.env.NODE_ENV == 'production', | ||
): Twind { | ||
return install$(config as TwindConfig, isProduction) | ||
} | ||
export { install as default } from '@twind/core' |