Skip to content

Commit

Permalink
fix: hmr and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Oct 23, 2024
1 parent 33d6181 commit 904e79c
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/light-mice-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"10up-toolkit": minor
---

Introducing Vanilla-extract support
21 changes: 15 additions & 6 deletions package-lock.json

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

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ exports[`webpack.config.js includes react-webpack-fast-refresh with the --hot op
"cacheDirectory": true,
"configFile": false,
"plugins": [
"/node_modules/react-refresh/babel.js",
[
"/node_modules/react-refresh/babel.js",
{
"skipEnvCheck": true,
},
],
],
"presets": [
[
Expand Down Expand Up @@ -109,7 +114,12 @@ exports[`webpack.config.js includes react-webpack-fast-refresh with the --hot op
"babelrc": false,
"configFile": false,
"plugins": [
"/node_modules/react-refresh/babel.js",
[
"/node_modules/react-refresh/babel.js",
{
"skipEnvCheck": true,
},
],
],
"presets": [
[
Expand Down
9 changes: 6 additions & 3 deletions packages/toolkit/config/webpack/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ module.exports = ({
babelrc: false,
configFile: false,
sourceType: 'unambiguous',
plugins: [hasReactFastRefresh && require.resolve('react-refresh/babel')].filter(
Boolean,
),
plugins: [
hasReactFastRefresh && [
require.resolve('react-refresh/babel'),
{ skipEnvCheck: true },
],
].filter(Boolean),
presets: [
[
require.resolve('@10up/babel-preset-default'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { style } from '@vanilla-extract/css';

export const container = style({
border: '2px dashed black',
backgroundColor: 'blue',
backgroundColor: 'red',
});
9 changes: 3 additions & 6 deletions projects/10up-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.1.5-next.7",
"private": true,
"scripts": {
"start": "10up-toolkit start",
"start": "10up-toolkit start --hot",
"watch": "10up-toolkit start",
"build": "10up-toolkit build",
"format-js": "10up-toolkit format-js",
Expand All @@ -19,7 +19,7 @@
"devDependencies": {
"@linaria/babel-preset": "^5.0.3",
"@linaria/webpack-loader": "^5.0.3",
"@wordpress/env": "^5.0.0",
"@wordpress/env": "^10.10.0",
"10up-toolkit": "^6.3.0-next.0"
},
"dependencies": {
Expand All @@ -35,7 +35,7 @@
},
"10up-toolkit": {
"useBlockAssets": true,
"useScriptModules": true,
"useScriptModules": false,
"loadBlockSpecificStyles": true,
"entry": {
"admin": "./assets/js/admin/admin.js",
Expand All @@ -48,9 +48,6 @@
"styleguide-style": "./assets/css/styleguide/styleguide.css",
"core-block-overrides": "./includes/core-block-overrides.js",
"test-style": "./assets/css/frontend/testing.scss"
},
"moduleEntry": {
"frontend-module": "./assets/js/frontend/frontend-module.js"
}
}
}

0 comments on commit 904e79c

Please sign in to comment.