diff --git a/gulpfile.js b/gulpfile.js index 16179f6..6600f0a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -165,7 +165,7 @@ gulp.task('generate-service-worker', function(callback) { }); gulp.task('packageExtension', function() { - child_process.execSync('cp -R app extension/'); + child_process.execSync('cp -R app extension'); child_process.execSync('cp src/manifest.json extension'); child_process.execSync('cp src/options.js extension'); child_process.execSync('cp src/options.html extension'); diff --git a/src/utils.js b/src/utils.js index 3b51630..8ea281c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -462,7 +462,11 @@ export function getFilenameFromUrl(url) { export function prettify(content, type = 'js') { const d = deferred(); - const worker = new Worker(`${BASE_PATH}/lib/prettier-worker.js`); + const worker = new Worker( + chrome.extension + ? chrome.extension.getURL('lib/prettier-worker.js') + : `${BASE_PATH}/lib/prettier-worker.js` + ); worker.postMessage({ content, type }); worker.addEventListener('message', e => { d.resolve(e.data);