feat: add debug mode (#47)

* feat: add debug mode
This commit is contained in:
Ryan Carniato 2020-10-30 12:18:45 -07:00 committed by GitHub
parent 338a980aa3
commit 0ab2bf1d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 0 deletions

35
package-lock.json generated
View File

@ -5461,6 +5461,41 @@
}
}
},
"@rollup/plugin-replace": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.3.tgz",
"integrity": "sha512-XPmVXZ7IlaoWaJLkSCDaa0Y6uVo5XQYHhiMFzOd5qSv5rE+t/UJToPIOE56flKIxBFQI27ONsxb7dqHnwSsjKQ==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.0.8",
"magic-string": "^0.25.5"
}
},
"@rollup/pluginutils": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
"dev": true,
"requires": {
"@types/estree": "0.0.39",
"estree-walker": "^1.0.1",
"picomatch": "^2.2.2"
},
"dependencies": {
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"dev": true
},
"estree-walker": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
"integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==",
"dev": true
}
}
},
"@tootallnate/once": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",

View File

@ -19,6 +19,7 @@
"@commitlint/config-lerna-scopes": "^11.0.0",
"@ebay/browserslist-config": "^1.0.1",
"@istanbuljs/nyc-config-typescript": "^0.1.3",
"@rollup/plugin-replace": "2.3.3",
"@types/jsdom": "^12.2.4",
"@types/mocha": "^5.2.7",
"@types/node": "^12.7.3",

View File

@ -1,6 +1,7 @@
import typescript from "rollup-plugin-typescript2";
import { terser } from "rollup-plugin-terser";
import mangleInternal from "../../utilities/rollup-plugin-mangle-internal";
import replace from "@rollup/plugin-replace";
import fs from "fs";
const sizeOnly = process.env.SIZE;
@ -26,6 +27,11 @@ export default envs.flatMap(env =>
compilerOptions: { declaration: false, emitDeclarationOnly: false }
}
}),
env === "dist" &&
replace({
'"MARKO_DEBUG"': false,
delimiters: ["", ""]
}),
env === "dist" && mangleInternal(),
env === "dist" &&
terser({