Commit 27b90673 authored by Konstantin Kitmanov's avatar Konstantin Kitmanov

сборка svelte-компонентов с минификацией

parent 7cdef1dd
This diff is collapsed.
......@@ -6,7 +6,7 @@
"main": "src/index.html",
"scripts": {
"svelte-dev": "rollup -c -w",
"svelte-prod": "rollup -c",
"svelte-prod": "rollup -c --environment BUILD:production",
"clean": "rm -rf ./build && mkdir build && mkdir build\\sound",
"precompile": "tweego -d src/index.html > build/index.twee && cp src/*.ttf build && cp src/sound/* build/sound",
"compile": "tweego --head=src/extras.html build/index.twee > build/index.html",
......@@ -37,6 +37,7 @@
"rollup": "^1.9.0",
"rollup-plugin-node-resolve": "^4.2.2",
"rollup-plugin-svelte": "^5.0.3",
"rollup-plugin-terser": "^4.0.4",
"svelte": "^2.16.1"
},
"dependencies": {
......
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
const isProduction = process.env.BUILD === 'production';
const sveltePlugin = svelte({
// By default, all .svelte and .html files are compiled
......@@ -19,5 +22,8 @@ export default {
plugins: [
sveltePlugin,
resolvePlugin,
isProduction && terser({
sourcemap: false,
}),
],
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment