Use a Snowpack plugin to enable React Fast Refresh (#845)
This commit is contained in:
parent
ca03bb4cc9
commit
eaeebdc242
5 changed files with 14 additions and 2 deletions
1
package-lock.json
generated
1
package-lock.json
generated
|
@ -32,6 +32,7 @@
|
||||||
"@jest/types": "^27.0.6",
|
"@jest/types": "^27.0.6",
|
||||||
"@snowpack/app-scripts-react": "^1.12.6",
|
"@snowpack/app-scripts-react": "^1.12.6",
|
||||||
"@snowpack/plugin-postcss": "1.4.3",
|
"@snowpack/plugin-postcss": "1.4.3",
|
||||||
|
"@snowpack/plugin-react-refresh": "^2.5.0",
|
||||||
"@snowpack/plugin-typescript": "^1.2.1",
|
"@snowpack/plugin-typescript": "^1.2.1",
|
||||||
"@snowpack/plugin-webpack": "3.0.0",
|
"@snowpack/plugin-webpack": "3.0.0",
|
||||||
"@storybook/addon-actions": "^6.3.4",
|
"@storybook/addon-actions": "^6.3.4",
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
"@jest/types": "^27.0.6",
|
"@jest/types": "^27.0.6",
|
||||||
"@snowpack/app-scripts-react": "^1.12.6",
|
"@snowpack/app-scripts-react": "^1.12.6",
|
||||||
"@snowpack/plugin-postcss": "1.4.3",
|
"@snowpack/plugin-postcss": "1.4.3",
|
||||||
|
"@snowpack/plugin-react-refresh": "^2.5.0",
|
||||||
"@snowpack/plugin-typescript": "^1.2.1",
|
"@snowpack/plugin-typescript": "^1.2.1",
|
||||||
"@snowpack/plugin-webpack": "3.0.0",
|
"@snowpack/plugin-webpack": "3.0.0",
|
||||||
"@storybook/addon-actions": "^6.3.4",
|
"@storybook/addon-actions": "^6.3.4",
|
||||||
|
|
|
@ -3,7 +3,11 @@ module.exports = {
|
||||||
proxy: {
|
proxy: {
|
||||||
"/auth/admin": "http://localhost:8180/auth/admin/",
|
"/auth/admin": "http://localhost:8180/auth/admin/",
|
||||||
},
|
},
|
||||||
plugins: ["@snowpack/plugin-postcss", "@snowpack/plugin-typescript"],
|
plugins: [
|
||||||
|
"@snowpack/plugin-postcss",
|
||||||
|
"@snowpack/plugin-react-refresh",
|
||||||
|
"@snowpack/plugin-typescript",
|
||||||
|
],
|
||||||
buildOptions: {
|
buildOptions: {
|
||||||
baseUrl: "/adminv2",
|
baseUrl: "/adminv2",
|
||||||
clean: true,
|
clean: true,
|
||||||
|
|
|
@ -13,3 +13,9 @@ init().then((adminClient) => {
|
||||||
document.getElementById("app")
|
document.getElementById("app")
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.
|
||||||
|
// Learn more: https://snowpack.dev/concepts/hot-module-replacement
|
||||||
|
if (import.meta.hot) {
|
||||||
|
import.meta.hot.accept();
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "@snowpack/app-scripts-react/tsconfig.base.json",
|
"extends": "@snowpack/app-scripts-react/tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"types": ["jest", "cypress"],
|
"types": ["jest", "cypress", "snowpack-env"],
|
||||||
"esModuleInterop": true
|
"esModuleInterop": true
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue