1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Tools: Fix desktop build performance issue (#6762)

This commit is contained in:
asrient 2022-08-19 23:40:39 +05:30 committed by GitHub
parent 7e8a6dfb54
commit b4ece67092
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 28 deletions

View File

@ -48,20 +48,6 @@ function convertJsx(paths) {
});
}
function build(path) {
chdir(path);
const result = spawnSync('yarn', ['run', 'build'], { shell: true });
if (result.status !== 0) {
const msg = [];
if (result.stdout) msg.push(result.stdout.toString());
if (result.stderr) msg.push(result.stderr.toString());
console.error(msg.join('\n'));
if (result.error) console.error(result.error);
process.exit(result.status);
}
}
module.exports = function() {
convertJsx([
`${__dirname}/../gui`,
@ -70,8 +56,6 @@ module.exports = function() {
`${__dirname}/../plugins`,
]);
build(`${__dirname}/../../pdf-viewer`);
const libContent = [
fs.readFileSync(`${basePath}/packages/lib/string-utils-common.js`, 'utf8'),
fs.readFileSync(`${basePath}/packages/lib/markJsUtils.js`, 'utf8'),

View File

@ -1,17 +1,29 @@
# PDF VIEWER
//Todo
A custom built PDF viewer for Joplin's use.
The viewer is designed to be rendered in an iframe.
This package produces the build files in `/dist` folder.
## Usage
## Installation & Usage
```javascript
import viewer from '@joplin/pdf-viewer';
From root of the project:
```bash
yarn install
```
This step will also run `yarn build` and build the viewer on post-install and populate the `/dist` folder.
We are using `weback` for build process.
When working on the viewer, after code updates you need to rebuild the viewer:
```bash
yarn build
```
## Notes
Alternatively, you can use `yarn watch` to rebuild automatically on code changes.
//Todo
```bash
yarn watch
```
## License
MIT
The build process of `app-desktop` takes care of copying the content of `/dist` and the root html file to appropriate location.

View File

@ -10,10 +10,11 @@
},
"scripts": {
"tsc": "tsc --project tsconfig.json",
"watch": "tsc --watch --preserveWatchOutput --project tsconfig.json",
"build": "webpack --config webpack.config.js",
"watch": "webpack --watch --config webpack.config.js --mode=development",
"build": "webpack --config webpack.config.js --mode=production",
"test": "jest",
"test-ci": "yarn test"
"test-ci": "yarn test",
"postinstall": "yarn build"
},
"author": "Joplin",
"license": "MIT",