Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Commit f1bf77a

Browse filesBrowse files
dafndafn
dafn
authored and
dafn
committed
Add scss support and extract minified styles
1 parent 074a523 commit f1bf77a
Copy full SHA for f1bf77a

File tree

Expand file treeCollapse file tree

6 files changed

+2393
-285
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+2393
-285
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# svelte-typescript-rollup
1+
# Svelte + Typescript + Rollup
22

3-
Minimal boilerplate example of Svelte with Typescript using Rollup
3+
Minimal boilerplate example of Svelte with Typescript using Rollup.
4+
This also includes SCSS support
45

56
Install packages
67
```bash

‎package.json

Copy file name to clipboardExpand all lines: package.json
+12-10Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@
88
"build": "rm -rf ./dist && NODE_ENV=production rollup --config"
99
},
1010
"dependencies": {
11-
"svelte": "^3.9.1"
11+
"svelte": "^3.17.2"
1212
},
1313
"devDependencies": {
14-
"rollup": "^1.20.0",
15-
"rollup-plugin-bundle-html": "^0.2.1",
16-
"rollup-plugin-commonjs": "^10.0.2",
17-
"rollup-plugin-css-porter": "^1.0.2",
18-
"rollup-plugin-livereload": "^1.0.1",
14+
"node-sass": "^4.13.1",
15+
"rollup": "^1.29.1",
16+
"rollup-plugin-bundle-html": "^0.2.2",
17+
"rollup-plugin-commonjs": "^10.1.0",
18+
"rollup-plugin-livereload": "^1.0.4",
1919
"rollup-plugin-node-resolve": "^5.2.0",
20+
"rollup-plugin-postcss": "^2.0.3",
21+
"rollup-plugin-scss": "^2.1.0",
2022
"rollup-plugin-serve": "^1.0.1",
21-
"rollup-plugin-svelte": "^5.1.0",
22-
"rollup-plugin-terser": "^5.1.1",
23+
"rollup-plugin-svelte": "^5.1.1",
24+
"rollup-plugin-terser": "^5.2.0",
2325
"rollup-plugin-typescript2": "^0.22.1",
24-
"svelte-preprocess": "^3.1.0",
25-
"typescript": "^3.5.3"
26+
"svelte-preprocess": "^3.3.0",
27+
"typescript": "^3.7.5"
2628
}
2729
}

‎rollup.config.js

Copy file name to clipboardExpand all lines: rollup.config.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import commonjs from "rollup-plugin-commonjs"
33
import resolve from "rollup-plugin-node-resolve"
44
import serve from "rollup-plugin-serve"
55
import html from "rollup-plugin-bundle-html"
6-
import css from "rollup-plugin-css-porter"
6+
import postcss from "rollup-plugin-postcss"
77
import typescript from "rollup-plugin-typescript2"
88
import typescriptCompiler from "typescript"
99
import { terser } from "rollup-plugin-terser"
@@ -15,15 +15,15 @@ const plugins = [
1515
dev: process.env.NODE_ENV === "development",
1616
extensions: [".svelte"],
1717
preprocess: sveltePreprocessor(),
18+
emitCss: true,
1819
}),
1920
html({
2021
template: "src/index.html",
2122
dest: "dist",
2223
filename: "index.html"
2324
}),
24-
css({
25-
dest: 'dist/index.css',
26-
raw: false
25+
postcss({
26+
extract: true
2727
}),
2828
typescript({ typescript: typescriptCompiler }),
2929
commonjs({ include: "node_modules/**" }),

‎src/index.svelte

Copy file name to clipboardExpand all lines: src/index.svelte
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
c: string = "Rollup";
55
</script>
66

7-
<style>
7+
<style lang="scss">
88
:global(body) {
99
display: flex;
1010
justify-content: center;

‎tsconfig.json

Copy file name to clipboardExpand all lines: tsconfig.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es6",
44
"baseUrl": "./"
55
},
66
"include": [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.