mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
docs: remove app hydration
This commit is contained in:
parent
e382038850
commit
5eab3474db
3 changed files with 13 additions and 17 deletions
|
@ -7,7 +7,6 @@
|
|||
<title>Carbon Components Svelte</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import App from "./App.svelte";
|
||||
|
||||
const app = new App({
|
||||
target: document.getElementById("app"),
|
||||
hydrate: process.env.NODE_ENV === "production",
|
||||
});
|
||||
const app = new App({ target: document.body });
|
||||
|
||||
export default app;
|
||||
|
|
|
@ -7,7 +7,6 @@ const { format } = require("prettier");
|
|||
const pkg = require("../package.json");
|
||||
const fs = require("fs");
|
||||
const Prism = require("prismjs");
|
||||
const { replace, postcss } = require("svelte-preprocess");
|
||||
require("prism-svelte");
|
||||
|
||||
function createImports(source) {
|
||||
|
@ -57,6 +56,7 @@ function createImports(source) {
|
|||
function plugin() {
|
||||
function visitor(node) {
|
||||
if (
|
||||
node.lang !== "svelte" &&
|
||||
!node.value.startsWith("<FileSource") &&
|
||||
!node.value.startsWith("<script>") &&
|
||||
!node.value.match(/svx-ignore/g)
|
||||
|
@ -125,19 +125,19 @@ const NODE_ENV = process.env.NODE_ENV || "production";
|
|||
|
||||
module.exports = {
|
||||
extensions: [".svelte", ".svx"],
|
||||
hydratable: NODE_ENV === "production",
|
||||
preprocess: [
|
||||
require("svelte-preprocess")(),
|
||||
replace([
|
||||
require("svelte-preprocess")({
|
||||
replace: [
|
||||
["process.env.VERSION", JSON.stringify(pkg.version)],
|
||||
["process.env.NODE_ENV", JSON.stringify(NODE_ENV)],
|
||||
]),
|
||||
postcss({
|
||||
],
|
||||
postcss: {
|
||||
plugins: [
|
||||
require("autoprefixer")({
|
||||
overrideBrowserslist: ["last 1 version", "ie >= 11"],
|
||||
}),
|
||||
],
|
||||
},
|
||||
}),
|
||||
mdsvex({
|
||||
remarkPlugins: [plugin, slug, carbonify],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue