Skip to content

Commit

Permalink
refactor(project): remove theme-preval.js (#3243)
Browse files Browse the repository at this point in the history
* refactor(project): remove theme-preval.js

* chore: remove babel-plugin-preval

* chore: remove transform-commonjs plugin

* chore: remove theme preval snapshot

---------

Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
  • Loading branch information
joshblack and joshblack authored May 15, 2023
1 parent 0e52737 commit 8733988
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 4,840 deletions.
13 changes: 1 addition & 12 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ function replacementPlugin(env) {

const sharedPlugins = [
'macros',
'preval',
'dev-expression',
'add-react-displayname',
'babel-plugin-styled-components',
Expand All @@ -22,17 +21,7 @@ module.exports = {
env: {
development: {
presets: makePresets(process.env.BABEL_MODULE || false),
plugins: [
...(process.env.BABEL_MODULE === 'commonjs'
? ['@babel/plugin-transform-modules-commonjs']
: process.env.STORYBOOK
? []
: [
'transform-commonjs', // theme-preval is commonjs and needs to be transformed to esm
]),
...sharedPlugins,
replacementPlugin('development'),
],
plugins: [...sharedPlugins, replacementPlugin('development')],
},
production: {
presets: makePresets(false),
Expand Down
51 changes: 0 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@
"babel-plugin-dev-expression": "0.2.3",
"babel-plugin-macros": "3.1.0",
"babel-plugin-open-source": "1.3.4",
"babel-plugin-preval": "5.1.0",
"babel-plugin-styled-components": "2.1.1",
"babel-plugin-transform-commonjs": "1.1.6",
"babel-plugin-transform-replace-expressions": "0.2.0",
"babel-polyfill": "6.26.0",
"change-case": "4.1.2",
Expand Down
7 changes: 2 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ function createPackageRegex(name) {
const baseConfig = {
input: Array.from(input),
plugins: [
// Note: it's important that the babel-plugin-preval is loaded first
// to work as-intended
babel({
extensions,
exclude: /node_modules/,
Expand All @@ -90,7 +88,6 @@ const baseConfig = {
],
plugins: [
'macros',
'preval',
'add-react-displayname',
'dev-expression',
'babel-plugin-styled-components',
Expand All @@ -106,10 +103,10 @@ const baseConfig = {
],
],
}),
commonjs({
resolve({
extensions,
}),
resolve({
commonjs({
extensions,
}),
postcss({
Expand Down
Loading

0 comments on commit 8733988

Please sign in to comment.