diff --git a/packages/generator-joplin/generators/app/templates/webpack.config.js b/packages/generator-joplin/generators/app/templates/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/generator-joplin/generators/app/templates/webpack.config.js +++ b/packages/generator-joplin/generators/app/templates/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts',