tswatch/dist_ts/tswatch.classes.parcel.js
2020-05-22 07:25:34 +00:00

44 lines
2.9 KiB
JavaScript

"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = __importStar(require("./tswatch.plugins"));
const paths = __importStar(require("./tswatch.paths"));
class Parcel {
async start() {
const entryFiles = plugins.path.join(paths.cwd, './html/index.html');
// Bundler options
const options = {
outDir: './dist_watch',
outFile: 'index.html',
publicUrl: '/',
watch: true,
cache: true,
cacheDir: '.nogit/.parcelcache',
contentHash: false,
global: 'moduleName',
minify: false,
scopeHoist: false,
target: 'browser',
bundleNodeModules: true,
https: null,
logLevel: 3,
hmr: true,
hmrPort: 3003,
sourceMaps: true,
hmrHostname: '',
detailedReport: false // Prints a detailed report of the bundles, assets, filesizes and times, defaults to false, reports are only printed if watch is disabled
};
const bundler = new plugins.parcel(entryFiles, 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.serve(3002);
}
}
exports.Parcel = Parcel;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5jbGFzc2VzLnBhcmNlbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rzd2F0Y2guY2xhc3Nlcy5wYXJjZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsMkRBQTZDO0FBQzdDLHVEQUF5QztBQUV6QyxNQUFhLE1BQU07SUFDVixLQUFLLENBQUMsS0FBSztRQUNoQixNQUFNLFVBQVUsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxFQUFFLG1CQUFtQixDQ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