bundle more stuff

This commit is contained in:
Rich Harris
2018-08-19 16:15:04 -04:00
parent dba83641e4
commit e0d533f2ea
9 changed files with 35 additions and 36 deletions

5
package-lock.json generated
View File

@@ -389,11 +389,6 @@
"integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
"dev": true "dev": true
}, },
"ansi-colors": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-2.0.5.tgz",
"integrity": "sha512-yAdfUZ+c2wetVNIFsNRn44THW+Lty6S5TwMpUfLA/UaGhiXbBv/F8E60/1hMLd0cnF/CDoWH8vzVaI5bAcHCjw=="
},
"ansi-escapes": { "ansi-escapes": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",

View File

@@ -19,23 +19,10 @@
"test": "test" "test": "test"
}, },
"dependencies": { "dependencies": {
"ansi-colors": "^2.0.1", "chokidar": "^2.0.4",
"chokidar": "^2.0.3",
"cookie": "^0.3.1",
"devalue": "^1.0.4",
"html-minifier": "^3.5.16", "html-minifier": "^3.5.16",
"mkdirp": "^0.5.1",
"node-fetch": "^2.1.1",
"pretty-bytes": "^5.0.0",
"pretty-ms": "^3.1.0",
"require-relative": "^0.8.7",
"rimraf": "^2.6.2",
"sade": "^1.4.1",
"sander": "^0.6.0",
"source-map-support": "^0.5.6", "source-map-support": "^0.5.6",
"tslib": "^1.9.1", "tslib": "^1.9.1"
"url-parse": "^1.2.0",
"webpack-format-messages": "^2.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/glob": "^5.0.34", "@types/glob": "^5.0.34",
@@ -44,28 +31,41 @@
"@types/node": "^10.7.1", "@types/node": "^10.7.1",
"@types/rimraf": "^2.0.2", "@types/rimraf": "^2.0.2",
"compression": "^1.7.1", "compression": "^1.7.1",
"cookie": "^0.3.1",
"devalue": "^1.0.4",
"eslint": "^4.13.1", "eslint": "^4.13.1",
"eslint-plugin-import": "^2.12.0", "eslint-plugin-import": "^2.12.0",
"express": "^4.16.3", "express": "^4.16.3",
"kleur": "^2.0.1",
"mkdirp": "^0.5.1",
"mocha": "^5.2.0", "mocha": "^5.2.0",
"nightmare": "^3.0.0", "nightmare": "^3.0.0",
"node-fetch": "^2.1.1",
"npm-run-all": "^4.1.3", "npm-run-all": "^4.1.3",
"polka": "^0.4.0", "polka": "^0.4.0",
"port-authority": "^1.0.5", "port-authority": "^1.0.5",
"pretty-bytes": "^5.0.0",
"pretty-ms": "^3.1.0",
"require-relative": "^0.8.7",
"rimraf": "^2.6.2",
"rollup": "^0.59.2", "rollup": "^0.59.2",
"rollup-plugin-commonjs": "^9.1.3", "rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-json": "^3.0.0", "rollup-plugin-json": "^3.0.0",
"rollup-plugin-node-resolve": "^3.3.0", "rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-string": "^2.0.2", "rollup-plugin-string": "^2.0.2",
"rollup-plugin-typescript": "^0.8.1", "rollup-plugin-typescript": "^0.8.1",
"sade": "^1.4.1",
"sander": "^0.6.0",
"serve-static": "^1.13.2", "serve-static": "^1.13.2",
"svelte": "^2.6.3", "svelte": "^2.6.3",
"svelte-loader": "^2.9.0", "svelte-loader": "^2.9.0",
"tiny-glob": "^0.2.2", "tiny-glob": "^0.2.2",
"ts-node": "^7.0.1", "ts-node": "^7.0.1",
"typescript": "^2.8.3", "typescript": "^2.8.3",
"url-parse": "^1.2.0",
"walk-sync": "^0.3.2", "walk-sync": "^0.3.2",
"webpack": "^4.8.3" "webpack": "^4.8.3",
"webpack-format-messages": "^2.0.1"
}, },
"scripts": { "scripts": {
"cy:open": "cypress open", "cy:open": "cypress open",

View File

@@ -454,19 +454,23 @@ class DevServer {
function noop() {} function noop() {}
function watch_files(pattern: string, events: string[], callback: () => void) { function watch_files(pattern: string, events: string[], callback: () => void) {
const chokidar = require('chokidar'); let watcher;
const watcher = chokidar.watch(pattern, { import('chokidar').then(({ default: chokidar }) => {
persistent: true, if (closed) return;
ignoreInitial: true,
disableGlobbing: true
});
events.forEach(event => { watcher = chokidar.watch(pattern, {
watcher.on(event, callback); persistent: true,
ignoreInitial: true,
disableGlobbing: true
});
events.forEach(event => {
watcher.on(event, callback);
});
}); });
return { return {
close: () => watcher.close() close: () => watcher && watcher.close()
}; };
} }

View File

@@ -1,7 +1,7 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import sade from 'sade'; import sade from 'sade';
import * as colors from 'ansi-colors'; import colors from 'kleur';
import prettyMs from 'pretty-ms'; import prettyMs from 'pretty-ms';
import * as pkg from '../package.json'; import * as pkg from '../package.json';

View File

@@ -1,5 +1,5 @@
import { build as _build } from '../api/build'; import { build as _build } from '../api/build';
import * as colors from 'ansi-colors'; import colors from 'kleur';
import { locations } from '../config'; import { locations } from '../config';
export function build() { export function build() {

View File

@@ -1,5 +1,5 @@
import * as path from 'path'; import * as path from 'path';
import * as colors from 'ansi-colors'; import colors from 'kleur';
import * as child_process from 'child_process'; import * as child_process from 'child_process';
import prettyMs from 'pretty-ms'; import prettyMs from 'pretty-ms';
import { dev as _dev } from '../api/dev'; import { dev as _dev } from '../api/dev';

View File

@@ -1,5 +1,5 @@
import { exporter as _exporter } from '../api/export'; import { exporter as _exporter } from '../api/export';
import * as colors from 'ansi-colors'; import colors from 'kleur';
import prettyBytes from 'pretty-bytes'; import prettyBytes from 'pretty-bytes';
import { locations } from '../config'; import { locations } from '../config';

View File

@@ -1,7 +1,7 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import * as child_process from 'child_process'; import * as child_process from 'child_process';
import * as colors from 'ansi-colors'; import colors from 'kleur';
import * as ports from 'port-authority'; import * as ports from 'port-authority';
export async function start(dir: string, opts: { port: number, open: boolean }) { export async function start(dir: string, opts: { port: number, open: boolean }) {

View File

@@ -1,5 +1,5 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as colors from 'ansi-colors'; import colors from 'kleur';
export default async function upgrade() { export default async function upgrade() {
const upgraded = [ const upgraded = [