-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transpile packages that contain browser code (#520)
- Loading branch information
1 parent
64791f3
commit b294764
Showing
3 changed files
with
29 additions
and
11 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,12 @@ | ||
--- | ||
'@vanilla-extract/css': patch | ||
'@vanilla-extract/dynamic': patch | ||
'@vanilla-extract/private': patch | ||
'@vanilla-extract/recipes': patch | ||
'@vanilla-extract/sprinkles': patch | ||
'@vanilla-extract/css-utils': patch | ||
--- | ||
|
||
Transpile code to meet [esmodules target](https://babeljs.io/docs/en/babel-preset-env#targetsesmodules) | ||
|
||
This should allow code that runs in the browser to conform to most browser policies. If you need to support browsers prior to the esmodules target (e.g. IE 11) then you'll need to configure custom transpilation in your projects. |
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,9 +1,5 @@ | ||
const baseConfig = require('./babel.config'); | ||
|
||
module.exports = { | ||
...baseConfig, | ||
plugins: [ | ||
...(baseConfig.plugins ?? []), | ||
require.resolve('@vanilla-extract/babel-plugin'), | ||
], | ||
extends: './babel.config', | ||
presets: [['@babel/preset-env', { targets: { node: 'current' } }]], | ||
plugins: [require.resolve('@vanilla-extract/babel-plugin')], | ||
}; |
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,7 +1,17 @@ | ||
module.exports = { | ||
presets: [ | ||
'@babel/preset-typescript', | ||
'@babel/preset-react', | ||
['@babel/preset-env', { targets: { node: 12 } }], | ||
presets: ['@babel/preset-typescript', '@babel/preset-react'], | ||
|
||
overrides: [ | ||
{ | ||
include: [ | ||
'./packages/css', | ||
'./packages/dynamic', | ||
'./packages/private', | ||
'./packages/recipes', | ||
'./packages/sprinkles', | ||
'./packages/utils', | ||
], | ||
presets: [['@babel/preset-env', { targets: { esmodules: true } }]], | ||
}, | ||
], | ||
}; |