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>
|
<title>Carbon Components Svelte</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
|
||||||
<script type="module" src="/src/index.js"></script>
|
<script type="module" src="/src/index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
import App from "./App.svelte";
|
import App from "./App.svelte";
|
||||||
|
|
||||||
const app = new App({
|
const app = new App({ target: document.body });
|
||||||
target: document.getElementById("app"),
|
|
||||||
hydrate: process.env.NODE_ENV === "production",
|
|
||||||
});
|
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
|
|
|
@ -7,7 +7,6 @@ const { format } = require("prettier");
|
||||||
const pkg = require("../package.json");
|
const pkg = require("../package.json");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const Prism = require("prismjs");
|
const Prism = require("prismjs");
|
||||||
const { replace, postcss } = require("svelte-preprocess");
|
|
||||||
require("prism-svelte");
|
require("prism-svelte");
|
||||||
|
|
||||||
function createImports(source) {
|
function createImports(source) {
|
||||||
|
@ -57,6 +56,7 @@ function createImports(source) {
|
||||||
function plugin() {
|
function plugin() {
|
||||||
function visitor(node) {
|
function visitor(node) {
|
||||||
if (
|
if (
|
||||||
|
node.lang !== "svelte" &&
|
||||||
!node.value.startsWith("<FileSource") &&
|
!node.value.startsWith("<FileSource") &&
|
||||||
!node.value.startsWith("<script>") &&
|
!node.value.startsWith("<script>") &&
|
||||||
!node.value.match(/svx-ignore/g)
|
!node.value.match(/svx-ignore/g)
|
||||||
|
@ -125,19 +125,19 @@ const NODE_ENV = process.env.NODE_ENV || "production";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extensions: [".svelte", ".svx"],
|
extensions: [".svelte", ".svx"],
|
||||||
hydratable: NODE_ENV === "production",
|
|
||||||
preprocess: [
|
preprocess: [
|
||||||
require("svelte-preprocess")(),
|
require("svelte-preprocess")({
|
||||||
replace([
|
replace: [
|
||||||
["process.env.VERSION", JSON.stringify(pkg.version)],
|
["process.env.VERSION", JSON.stringify(pkg.version)],
|
||||||
["process.env.NODE_ENV", JSON.stringify(NODE_ENV)],
|
["process.env.NODE_ENV", JSON.stringify(NODE_ENV)],
|
||||||
]),
|
],
|
||||||
postcss({
|
postcss: {
|
||||||
plugins: [
|
plugins: [
|
||||||
require("autoprefixer")({
|
require("autoprefixer")({
|
||||||
overrideBrowserslist: ["last 1 version", "ie >= 11"],
|
overrideBrowserslist: ["last 1 version", "ie >= 11"],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
mdsvex({
|
mdsvex({
|
||||||
remarkPlugins: [plugin, slug, carbonify],
|
remarkPlugins: [plugin, slug, carbonify],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue