Skip to content

Commit 12970e8

Browse files
committed
* [ADD] Drag and drop to load JSON file.
* [BUG] Fixed some bugs.
1 parent 0dbea9c commit 12970e8

19 files changed

+888
-38239
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
web-ext-artifacts/
2-
.idea/
2+
.idea/
3+
node_modules/

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@
1212
### Chrome
1313

1414
[Click to download!](https://github.com/webpatch/JSON-Editor-Extension/blob/master/dist/JSON-Editor-Extension.crx?raw=true)
15+
16+
17+
### Changelog
18+
19+
#### 1.0.2
20+
21+
* [ADD] Drag and drop to load JSON file.
22+
* [BUG] Fixed some bugs.

build/build.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const rollup = require('rollup');
2+
const buble = require('rollup-plugin-buble');
3+
const uglify = require('uglify-js');
4+
const fs = require('fs-extra');
5+
const commonjs = require('rollup-plugin-commonjs');
6+
const resolve = require('rollup-plugin-node-resolve');
7+
8+
const dist = (i = '') => `js/${i}`;
9+
fs.removeSync(dist());
10+
fs.ensureDirSync(dist());
11+
12+
const input_browser = {
13+
input: 'src/index.js',
14+
plugins: [resolve(), commonjs(), buble()],
15+
};
16+
17+
const output_browser = {
18+
file: dist('json-editor.js'),
19+
miniFile: dist('json-editor.min.js'),
20+
format: 'umd',
21+
name: 'dz',
22+
};
23+
24+
async function build(input, output) {
25+
const bundle = await rollup.rollup(input);
26+
let { code } = await bundle.generate(output);
27+
if (output.prefix) code = fs.readFileSync(output.prefix, 'utf8') + '\n' + code;
28+
fs.outputFileSync(output.file, code);
29+
30+
if (output.miniFile) {
31+
const minified = uglify.minify(code).code;
32+
fs.outputFileSync(output.miniFile, minified);
33+
}
34+
}
35+
36+
build(input_browser, output_browser);

dist/JSON-Editor-Extension.crx

2.43 MB
Binary file not shown.

0 commit comments

Comments
 (0)