Skip to content

Commit 384fd48

Browse files
committed
[add] initial version
0 parents  commit 384fd48

27 files changed

+1932
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/coverage/
2+
/node_modules/
3+
/public/build/
4+
5+
.DS_Store

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
DHTMLX Gantt for Svelte :: Demos
2+
---
3+
4+
## Get started
5+
6+
Install the dependencies...
7+
8+
```bash
9+
npm install
10+
```
11+
12+
...then start
13+
14+
```bash
15+
npm run dev
16+
```
17+
18+
Navigate to [localhost:5000](http://localhost:5000). You should see the demos running.

package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "svelte-app",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "rollup -c",
6+
"dev": "rollup -c -w",
7+
"start": "sirv public"
8+
},
9+
"devDependencies": {
10+
"@rollup/plugin-commonjs": "^17.0.0",
11+
"@rollup/plugin-node-resolve": "^11.0.0",
12+
"rollup": "^2.3.4",
13+
"rollup-plugin-css-only": "^3.1.0",
14+
"rollup-plugin-livereload": "^2.0.0",
15+
"rollup-plugin-svelte": "^7.0.0",
16+
"rollup-plugin-terser": "^7.0.0",
17+
"sirv-cli": "^1.0.0",
18+
"svelte": "^3.0.0"
19+
},
20+
"dependencies": {
21+
"@dhtmlx/trial-lib-gantt": "^0.3.2",
22+
"@dhtmlx/trial-svelte-gantt": "^0.2.0",
23+
"svelte-spa-router": "^3.1.0"
24+
}
25+
}

public/favicon.png

3.05 KB
Loading

public/index.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset='utf-8'>
5+
<meta name='viewport' content='width=device-width,initial-scale=1'>
6+
7+
<title>Svelte app</title>
8+
9+
<link rel='icon' type='image/png' href='/favicon.png'>
10+
<link rel='stylesheet' href='/build/bundle.css'>
11+
</head>
12+
13+
<body>
14+
<style>
15+
html,
16+
body {
17+
width: 100%;
18+
height: 100%;
19+
margin: 0;
20+
padding: 0;
21+
}
22+
</style>
23+
24+
<script src='/build/bundle.js'></script>
25+
<script>
26+
new app.Demos({
27+
target: document.body,
28+
});
29+
</script>
30+
</body>
31+
</html>

rollup.config.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import svelte from 'rollup-plugin-svelte';
2+
import commonjs from '@rollup/plugin-commonjs';
3+
import resolve from '@rollup/plugin-node-resolve';
4+
import livereload from 'rollup-plugin-livereload';
5+
import { terser } from 'rollup-plugin-terser';
6+
import css from 'rollup-plugin-css-only';
7+
8+
const production = !process.env.ROLLUP_WATCH;
9+
10+
function serve() {
11+
let server;
12+
13+
function toExit() {
14+
if (server) server.kill(0);
15+
}
16+
17+
return {
18+
writeBundle() {
19+
if (server) return;
20+
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
21+
stdio: ['ignore', 'inherit', 'inherit'],
22+
shell: true
23+
});
24+
25+
process.on('SIGTERM', toExit);
26+
process.on('exit', toExit);
27+
}
28+
};
29+
}
30+
31+
export default {
32+
input: 'src/index.js',
33+
output: {
34+
sourcemap: true,
35+
format: 'iife',
36+
name: 'app',
37+
file: 'public/build/bundle.js'
38+
},
39+
plugins: [
40+
svelte({
41+
compilerOptions: {
42+
// enable run-time checks when not in production
43+
dev: !production
44+
}
45+
}),
46+
// we'll extract any component CSS out into
47+
// a separate file - better for performance
48+
css({ output: 'bundle.css' }),
49+
50+
// If you have external dependencies installed from
51+
// npm, you'll most likely need these plugins. In
52+
// some cases you'll need additional configuration -
53+
// consult the documentation for details:
54+
// https://github.com/rollup/plugins/tree/master/packages/commonjs
55+
resolve({
56+
browser: true,
57+
dedupe: ['svelte']
58+
}),
59+
commonjs(),
60+
61+
// In dev mode, call `npm run start` once
62+
// the bundle has been generated
63+
!production && serve(),
64+
65+
// Watch the `public` directory and refresh the
66+
// browser on changes when not in production
67+
!production && livereload('public'),
68+
69+
// If we're building for production (npm run build
70+
// instead of npm run dev), minify
71+
production && terser()
72+
],
73+
watch: {
74+
clearScreen: false
75+
}
76+
};

0 commit comments

Comments
 (0)