mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Generator: Fixed webpack config
This commit is contained in:
parent
c67c8cefdf
commit
f36019c94d
@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) {
|
|||||||
const distFiles = glob.sync(`${sourceDir}/**/*`)
|
const distFiles = glob.sync(`${sourceDir}/**/*`)
|
||||||
.map(f => f.substr(sourceDir.length + 1));
|
.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);
|
fs.removeSync(destPath);
|
||||||
|
|
||||||
tar.create(
|
tar.create(
|
||||||
@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`;
|
|||||||
const manifest = readManifest(manifestPath);
|
const manifest = readManifest(manifestPath);
|
||||||
const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`);
|
const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`);
|
||||||
|
|
||||||
|
fs.removeSync(distDir);
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
entry: './src/index.ts',
|
entry: './src/index.ts',
|
||||||
|
Loading…
Reference in New Issue
Block a user