fix(core): update

This commit is contained in:
Philipp Kunz 2020-07-07 18:34:50 +00:00
parent 9abb00261d
commit c7d61bec0b
3 changed files with 27 additions and 8 deletions

18
package-lock.json generated
View File

@ -1756,7 +1756,6 @@
"version": "4.17.8",
"resolved": "https://verdaccio.lossless.one/@types%2fexpress-serve-static-core/-/express-serve-static-core-4.17.8.tgz",
"integrity": "sha512-1SJZ+R3Q/7mLkOD9ewCBDYD2k0WyZQtWYqF/2VvoNN2/uhI49J9CDN4OAm+wGMA0DbArA4ef27xl4+JwMtGggw==",
"dev": true,
"requires": {
"@types/node": "*",
"@types/qs": "*",
@ -1828,8 +1827,15 @@
"@types/node": {
"version": "10.17.26",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-10.17.26.tgz",
"integrity": "sha512-myMwkO2Cr82kirHY8uknNRHEVtn0wV3DTQfkrjx17jmkstDRZ24gNUdl8AHXVyVclTYI/bNjgTPTAWvWLqXqkw==",
"dev": true
"integrity": "sha512-myMwkO2Cr82kirHY8uknNRHEVtn0wV3DTQfkrjx17jmkstDRZ24gNUdl8AHXVyVclTYI/bNjgTPTAWvWLqXqkw=="
},
"@types/parcel-bundler": {
"version": "1.12.1",
"resolved": "https://verdaccio.lossless.one/@types%2fparcel-bundler/-/parcel-bundler-1.12.1.tgz",
"integrity": "sha512-I7Cy3Uy/HqMa3E7dyPxTkiPFx0gi3bIQxAcZCP8v1vFx+esdVFgbZBnusa6VfoIeFk61/fnVl25RyYKgDHVLtw==",
"requires": {
"@types/express-serve-static-core": "*"
}
},
"@types/portscanner": {
"version": "2.1.0",
@ -1854,14 +1860,12 @@
"@types/qs": {
"version": "6.9.3",
"resolved": "https://verdaccio.lossless.one/@types%2fqs/-/qs-6.9.3.tgz",
"integrity": "sha512-7s9EQWupR1fTc2pSMtXRQ9w9gLOcrJn+h7HOXw4evxyvVqMi4f+q7d2tnFe3ng3SNHjtK+0EzGMGFUQX4/AQRA==",
"dev": true
"integrity": "sha512-7s9EQWupR1fTc2pSMtXRQ9w9gLOcrJn+h7HOXw4evxyvVqMi4f+q7d2tnFe3ng3SNHjtK+0EzGMGFUQX4/AQRA=="
},
"@types/range-parser": {
"version": "1.2.3",
"resolved": "https://verdaccio.lossless.one/@types%2frange-parser/-/range-parser-1.2.3.tgz",
"integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==",
"dev": true
"integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA=="
},
"@types/relateurl": {
"version": "0.2.28",

View File

@ -21,7 +21,8 @@
},
"dependencies": {
"@pushrocks/smartpath": "^4.0.3",
"parcel-bundler": "^1.12.4"
"parcel-bundler": "^1.12.4",
"@types/parcel-bundler": "^1.12.1"
},
"files": [
"ts/**/*",

View File

@ -25,6 +25,9 @@ export class Parcel {
public options: plugins.parcel.ParcelOptions;
public entryFiles: string | string[] = plugins.path.join(process.cwd(), './html/index.html');
/**
* builds and serves
*/
public async start() {
const bundler = new plugins.parcel(this.entryFiles, this.options);
@ -33,6 +36,17 @@ export class Parcel {
const bundle = await bundler.serve(3002);
}
/**
* just builds
*/
public async build() {
const bundler = new plugins.parcel(this.entryFiles, this.options);
// Run the bundler, this returns the main bundle
// Use the events if you're using watch mode as this promise will only trigger once and not for every rebuild
const bundle = await bundler.bundle();
}
constructor(fromArg: string | string[], outputDirArg: string, outputFileArg: string) {
this.entryFiles = fromArg;
this.options = {