Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,402 changes: 832 additions & 570 deletions dist/autoComplete.js

Large diffs are not rendered by default.

Binary file modified dist/autoComplete.js.gz
Binary file not shown.
32 changes: 31 additions & 1 deletion dist/autoComplete.min.js

Large diffs are not rendered by default.

Binary file modified dist/autoComplete.min.js.gz
Binary file not shown.
1,402 changes: 832 additions & 570 deletions docs/demo/js/autoComplete.js

Large diffs are not rendered by default.

Binary file modified docs/demo/js/autoComplete.js.gz
Binary file not shown.
32 changes: 31 additions & 1 deletion docs/demo/js/autoComplete.min.js

Large diffs are not rendered by default.

Binary file modified docs/demo/js/autoComplete.min.js.gz
Binary file not shown.
3,064 changes: 437 additions & 2,627 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,18 @@
"unpkg": "dist/autoComplete.min.js",
"module": "dist/autoComplete.min.js",
"devDependencies": {
"@babel/core": "^7.18.6",
"@babel/preset-env": "^7.18.6",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-terser": "^0.4.4",
"acorn": "^8.7.1",
"rollup": "^4.24.0",
"@rollup/plugin-swc": "^0.4.0",
"acorn": "^8.15.0",
"rollup": "^4.44.2",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-gzip": "^4.0.1",
"rollup-plugin-gzip": "^4.1.1",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-nodent": "^0.2.2",
"rollup-plugin-serve": "^1.1.1",
"rollup-plugin-sizes": "^1.0.4"
"rollup-plugin-serve": "^3.0.0",
"rollup-plugin-sizes": "^1.1.0"
},
"scripts": {
"dev": "NODE_ENV=development rollup -c -w",
"build": "NODE_ENV=production rollup -c --bundleConfigAsCjs",
"build": "NODE_ENV=production rollup -c",
"docs": "jsdoc -c jsdocs.json"
},
"license": "Apache-2.0",
Expand Down
57 changes: 21 additions & 36 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import nodent from "rollup-plugin-nodent";
import babel from "@rollup/plugin-babel";
import cleanup from "rollup-plugin-cleanup";
import terser from "@rollup/plugin-terser";
import pkg from "./package.json" assert { type: "json" };
import pkg from "./package.json" with { type: "json" };
import gzipPlugin from "rollup-plugin-gzip";
import analyze from "rollup-plugin-analyzer";
import sizes from "rollup-plugin-sizes";
import serve from "rollup-plugin-serve";
import livereload from "rollup-plugin-livereload";
import swc from "@rollup/plugin-swc";

// Library Name
const libName = "autoComplete";
Expand All @@ -16,7 +13,11 @@ const isProduction = process.env.NODE_ENV === "production";
// Library Max. Size Allowed
const limitBytes = 3 * 1024 * 1024;
// Library Size Analyzer
let analyzePluginIterations = 0;
const onAnalysis = ({ bundleSize }) => {
if (analyzePluginIterations > 0) {
throw ""; // We only want reports on the first output
}
if (bundleSize < limitBytes) return;
console.log(`Bundle size exceeds ${limitBytes} bytes: ${bundleSize} bytes`);
return process.exit(1);
Expand All @@ -40,26 +41,15 @@ export default [
},
],
plugins: [
nodent({
es7: true,
promises: true,
// sourcemap: isProduction ? false : true,
noRuntime: true,
es6target: true,
}),
babel({
babelHelpers: "bundled",
exclude: "node_modules/**",
presets: ["@babel/preset-env"],
}),
cleanup(),
terser({
compress: {
drop_console: true,
swc({
swc: {
jsc: {
target: "es2015",
},
minify: true,
},
toplevel: true,
}),
gzipPlugin.default(),
gzipPlugin(),
],
},
{
Expand All @@ -78,20 +68,15 @@ export default [
},
],
plugins: [
nodent({
es7: true,
promises: true,
// sourcemap: isProduction ? false : true,
noRuntime: true,
es6target: true,
}),
babel({
babelHelpers: "bundled",
exclude: "node_modules/**",
presets: ["@babel/preset-env"],
swc({
swc: {
jsc: {
target: "es2015",
},
minify: false,
},
}),
cleanup(),
gzipPlugin.default(),
gzipPlugin(),
// Analyzer
analyze({
onAnalysis,
Expand Down
Loading