Replace tab => space

This commit is contained in:
Vadim
2021-01-24 18:28:23 +03:00
parent cb8fdf57d9
commit b539689024

View File

@@ -8,69 +8,69 @@ import css from 'rollup-plugin-css-only';
const production = !process.env.ROLLUP_WATCH; const production = !process.env.ROLLUP_WATCH;
function serve() { function serve() {
let server; let server;
function toExit() { function toExit() {
if (server) server.kill(0); if (server) server.kill(0);
} }
return { return {
writeBundle() { writeBundle() {
if (server) return; if (server) return;
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], { server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
stdio: ['ignore', 'inherit', 'inherit'], stdio: ['ignore', 'inherit', 'inherit'],
shell: true shell: true
}); });
process.on('SIGTERM', toExit); process.on('SIGTERM', toExit);
process.on('exit', toExit); process.on('exit', toExit);
} }
}; };
} }
export default { export default {
input: 'src/main.js', input: 'src/main.js',
output: { output: {
sourcemap: true, sourcemap: true,
format: 'es', format: 'es',
name: 'app', name: 'app',
file: 'dist/index.js' file: 'dist/index.js'
}, },
plugins: [ plugins: [
svelte({ svelte({
compilerOptions: { compilerOptions: {
// enable run-time checks when not in production // enable run-time checks when not in production
dev: !production dev: !production
} }
}), }),
// we'll extract any component CSS out into // we'll extract any component CSS out into
// a separate file - better for performance // a separate file - better for performance
css({ output: 'index.css' }), css({ output: 'index.css' }),
// If you have external dependencies installed from // If you have external dependencies installed from
// npm, you'll most likely need these plugins. In // npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration - // some cases you'll need additional configuration -
// consult the documentation for details: // consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs // https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({ resolve({
browser: true, browser: true,
dedupe: ['svelte'] dedupe: ['svelte']
}), }),
commonjs(), commonjs(),
// In dev mode, call `npm run start` once // In dev mode, call `npm run start` once
// the bundle has been generated // the bundle has been generated
!production && serve(), !production && serve(),
// Watch the `public` directory and refresh the // Watch the `public` directory and refresh the
// browser on changes when not in production // browser on changes when not in production
!production && livereload('public'), !production && livereload('public'),
// If we're building for production (npm run build // If we're building for production (npm run build
// instead of npm run dev), minify // instead of npm run dev), minify
production && terser() production && terser()
], ],
watch: { watch: {
clearScreen: false clearScreen: false
} }
}; };