-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
11,554 additions
and
11,497 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset='utf-8'> | ||
<meta name='viewport' content='width=device-width,initial-scale=1'> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
|
||
<title>Svelte Element</title> | ||
<title>Svelte Element</title> | ||
|
||
<link rel='icon' type='image/png' href='/favicon.ico'> | ||
<link rel='stylesheet' href='/css/element-vue/element-ui@2.14.1.css'> | ||
<link rel='stylesheet' href='/global.css'> | ||
<link rel='stylesheet' href='/prism-theme-vs-dark.css'> | ||
<link rel='stylesheet' href='/build/bundle.css'> | ||
<link rel="icon" type="image/png" href="./favicon.ico" /> | ||
<link rel="stylesheet" href="./css/element-vue/element-ui@2.14.1.css" /> | ||
<link rel="stylesheet" href="./global.css" /> | ||
<link rel="stylesheet" href="./prism-theme-vs-dark.css" /> | ||
<link rel="stylesheet" href="./build/bundle.css" /> | ||
|
||
<script src='/lib/svelte-draft/index.js'></script> | ||
<script defer src='/build/bundle.js'></script> | ||
</head> | ||
<script src="./lib/svelte-draft/index.js"></script> | ||
<script defer src="./build/bundle.js"></script> | ||
</head> | ||
|
||
<body> | ||
<script> | ||
// credit: https://www.smashingmagazine.com/2016/08/sghpa-single-page-app-hack-github-pages | ||
(function(){ | ||
var redirect = sessionStorage.redirect; | ||
delete sessionStorage.redirect; | ||
if (redirect && redirect != location.href) { | ||
history.replaceState(null, null, redirect); | ||
// REMOVE THIS - just showing the redirect route in the UI | ||
document.body.setAttribute('message', 'This page was redirected by 404.html, from the route: ' + redirect); | ||
} | ||
else { | ||
// REMOVE THIS - just showing the redirect route in the UI | ||
document.body.setAttribute('message', 'This page was loaded directly from the index.html file'); | ||
} | ||
})(); | ||
</script> | ||
</body> | ||
<body> | ||
<script> | ||
// credit: https://www.smashingmagazine.com/2016/08/sghpa-single-page-app-hack-github-pages | ||
(function () { | ||
var redirect = sessionStorage.redirect; | ||
delete sessionStorage.redirect; | ||
if (redirect && redirect != location.href) { | ||
history.replaceState(null, null, redirect); | ||
// REMOVE THIS - just showing the redirect route in the UI | ||
document.body.setAttribute( | ||
"message", | ||
"This page was redirected by 404.html, from the route: " + redirect | ||
); | ||
} else { | ||
// REMOVE THIS - just showing the redirect route in the UI | ||
document.body.setAttribute( | ||
"message", | ||
"This page was loaded directly from the index.html file" | ||
); | ||
} | ||
})(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,100 @@ | ||
import svelte from 'rollup-plugin-svelte'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import livereload from 'rollup-plugin-livereload'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
import svelte_draft from 'rollup-plugin-svelte-draft'; | ||
import globals from 'rollup-plugin-node-globals'; | ||
import svelte from "rollup-plugin-svelte"; | ||
import resolve from "@rollup/plugin-node-resolve"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import livereload from "rollup-plugin-livereload"; | ||
import { terser } from "rollup-plugin-terser"; | ||
import svelte_draft from "rollup-plugin-svelte-draft"; | ||
import globals from "rollup-plugin-node-globals"; | ||
import { string } from "rollup-plugin-string"; | ||
import { mdsvex } from "mdsvex"; | ||
import draftConfig from "./svelte-draft.config"; | ||
import replace from "@rollup/plugin-replace"; | ||
|
||
const production = !process.env.ROLLUP_WATCH; | ||
|
||
export default { | ||
input: 'src/main.ts', | ||
output: { | ||
sourcemap: true, | ||
format: 'iife', | ||
name: 'app', | ||
file: 'public/build/bundle.js', | ||
globals: { | ||
"svelte-draft": 'SvelteDraft' | ||
} | ||
}, | ||
external: ['svelte-draft'], | ||
plugins: [ | ||
string({ | ||
// Required to be specified | ||
include: "**/*.snippet" | ||
}), | ||
svelte_draft({ | ||
include: ["./src/**/*.tsx", "./src/**/*.ts"], config: draftConfig | ||
}), | ||
svelte({ | ||
extensions: [".tsx", ".svelte", ".svx"], | ||
preprocess: mdsvex({ | ||
layout: { | ||
docs: "./src/site/docs/layout/docs.svelte" | ||
} | ||
}), | ||
exclude: "./src/**/*.js.tsx", | ||
// enable run-time checks when not in production | ||
dev: !production, | ||
// we'll extract any component CSS out into | ||
// a separate file — better for performance | ||
css: css => { | ||
css.write('public/build/bundle.css'); | ||
} | ||
}), | ||
input: "src/main.ts", | ||
output: { | ||
sourcemap: true, | ||
format: "iife", | ||
name: "app", | ||
file: "public/build/bundle.js", | ||
globals: { | ||
"svelte-draft": "SvelteDraft" | ||
} | ||
}, | ||
external: ["svelte-draft"], | ||
plugins: [ | ||
replace({ | ||
__BuildEnv__: production ? JSON.stringify("prod") : JSON.stringify("dev") | ||
}), | ||
string({ | ||
// Required to be specified | ||
include: "**/*.snippet" | ||
}), | ||
svelte_draft({ | ||
include: ["./src/**/*.tsx", "./src/**/*.ts"], | ||
config: draftConfig | ||
}), | ||
svelte({ | ||
extensions: [".tsx", ".svelte", ".svx"], | ||
preprocess: mdsvex({ | ||
layout: { | ||
docs: "./src/site/docs/layout/docs.svelte" | ||
} | ||
}), | ||
exclude: "./src/**/*.js.tsx", | ||
// enable run-time checks when not in production | ||
dev: !production, | ||
// we'll extract any component CSS out into | ||
// a separate file — better for performance | ||
css: css => { | ||
css.write("public/build/bundle.css"); | ||
} | ||
}), | ||
|
||
// If you have external dependencies installed from | ||
// npm, you'll most likely need these plugins. In | ||
// some cases you'll need additional configuration — | ||
// consult the documentation for details: | ||
// https://github.com/rollup/plugins/tree/master/packages/commonjs | ||
resolve({ | ||
browser: true, | ||
dedupe: ['svelte'] | ||
}), | ||
commonjs(), | ||
globals(), | ||
// If you have external dependencies installed from | ||
// npm, you'll most likely need these plugins. In | ||
// some cases you'll need additional configuration — | ||
// consult the documentation for details: | ||
// https://github.com/rollup/plugins/tree/master/packages/commonjs | ||
resolve({ | ||
browser: true, | ||
dedupe: ["svelte"] | ||
}), | ||
commonjs(), | ||
globals(), | ||
|
||
// In dev mode, call `npm run start` once | ||
// the bundle has been generated | ||
!production && serve(), | ||
// In dev mode, call `npm run start` once | ||
// the bundle has been generated | ||
!production && serve(), | ||
|
||
// Watch the `public` directory and refresh the | ||
// browser on changes when not in production | ||
!production && livereload('public'), | ||
// Watch the `public` directory and refresh the | ||
// browser on changes when not in production | ||
!production && livereload("public"), | ||
|
||
// If we're building for production (npm run build | ||
// instead of npm run dev), minify | ||
production && terser() | ||
], | ||
watch: { | ||
clearScreen: false | ||
} | ||
// If we're building for production (npm run build | ||
// instead of npm run dev), minify | ||
production && terser() | ||
], | ||
watch: { | ||
clearScreen: false | ||
} | ||
}; | ||
|
||
function serve() { | ||
let started = false; | ||
let started = false; | ||
|
||
return { | ||
writeBundle() { | ||
if (!started) { | ||
started = true; | ||
return { | ||
writeBundle() { | ||
if (!started) { | ||
started = true; | ||
|
||
require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], { | ||
stdio: ['ignore', 'inherit', 'inherit'], | ||
shell: true | ||
}); | ||
} | ||
} | ||
}; | ||
require("child_process").spawn("npm", ["run", "start", "--", "--dev"], { | ||
stdio: ["ignore", "inherit", "inherit"], | ||
shell: true | ||
}); | ||
} | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Title from "./title"; | ||
import Title from "./Title"; | ||
|
||
export default function _() { | ||
<h1> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Title from "./title"; | ||
import Title from "./Title"; | ||
|
||
export default function _() { | ||
<h2> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Title from "./title"; | ||
import Title from "./Title"; | ||
|
||
export default function _() { | ||
<h3> | ||
|