|
@@ -1,70 +0,0 @@
|
|
|
-import { spawn } from 'node:child_process'
|
|
|
-
|
|
|
-import commonjs from '@rollup/plugin-commonjs'
|
|
|
-import resolve from '@rollup/plugin-node-resolve'
|
|
|
-import livereload from 'rollup-plugin-livereload'
|
|
|
-import { terser } from 'rollup-plugin-terser'
|
|
|
-import css from 'rollup-plugin-css-only'
|
|
|
-
|
|
|
-const production = !process.env.ROLLUP_WATCH
|
|
|
-
|
|
|
-function serve () {
|
|
|
- let server
|
|
|
-
|
|
|
- function toExit () {
|
|
|
- if (server) server.kill(0)
|
|
|
- }
|
|
|
-
|
|
|
- return {
|
|
|
- writeBundle () {
|
|
|
- if (server) return
|
|
|
- server = spawn('npm', ['run', 'serve', '--', '--dev'], {
|
|
|
- stdio: ['ignore', 'inherit', 'inherit'],
|
|
|
- shell: true,
|
|
|
- })
|
|
|
-
|
|
|
- process.on('SIGTERM', toExit)
|
|
|
- process.on('exit', toExit)
|
|
|
- },
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-export default {
|
|
|
- input: 'main.js',
|
|
|
- output: {
|
|
|
- sourcemap: true,
|
|
|
- format: 'iife',
|
|
|
- name: 'app',
|
|
|
- file: 'bundle.js',
|
|
|
- },
|
|
|
- plugins: [
|
|
|
-
|
|
|
-
|
|
|
- css({ output: 'uppy.min.css' }),
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- resolve({
|
|
|
- browser: true,
|
|
|
- }),
|
|
|
- commonjs(),
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- !production && serve(),
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- !production && livereload('public'),
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- production && terser(),
|
|
|
- ],
|
|
|
- watch: {
|
|
|
- clearScreen: false,
|
|
|
- },
|
|
|
-}
|