Browse Source
Merge pull request #708 from mengshukeji/test_esbuild
build(esbuild): add esbuild
master
Dushusir
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
27 additions and
7 deletions
-
gulpfile.js
-
package.json
-
src/controllers/menuButton.js
-
src/index.js
|
|
|
@ -177,7 +177,7 @@ function reloadBrowser(done) { |
|
|
|
} |
|
|
|
|
|
|
|
//Package the core code
|
|
|
|
async function core() { |
|
|
|
async function core_rollup() { |
|
|
|
const bundle = await rollup({ |
|
|
|
input: 'src/index.js', |
|
|
|
plugins: [ |
|
|
|
@ -215,6 +215,20 @@ async function core() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
async function core() { |
|
|
|
|
|
|
|
await require('esbuild').buildSync({ |
|
|
|
format: 'iife', |
|
|
|
globalName: 'luckysheet', |
|
|
|
entryPoints: ['src/index.js'], |
|
|
|
bundle: true, |
|
|
|
// minify: true,
|
|
|
|
sourcemap: true, |
|
|
|
outfile: 'dist/luckysheet.umd.js', |
|
|
|
logLevel: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// According to the build tag in html, package js and css
|
|
|
|
function pluginsCss() { |
|
|
|
return src(paths.pluginsCss) |
|
|
|
|
|
|
|
@ -38,6 +38,7 @@ |
|
|
|
"dependencies": { |
|
|
|
"@babel/runtime": "^7.12.1", |
|
|
|
"dayjs": "^1.9.6", |
|
|
|
"esbuild": "^0.11.6", |
|
|
|
"flatpickr": "^4.6.6", |
|
|
|
"jquery": "^2.2.4", |
|
|
|
"numeral": "^2.0.6", |
|
|
|
|
|
|
|
@ -275,8 +275,8 @@ const menuButton = { |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let prefix = "", main = ""; |
|
|
|
//Uncaught ReferenceError: Cannot access 'fa' before initialization
|
|
|
|
let prefix = "", main = "", fa = []; |
|
|
|
if(foucsStatus.fa.indexOf(".")>-1){ |
|
|
|
fa = foucsStatus.fa.split("."); |
|
|
|
prefix = fa[0]; |
|
|
|
@ -286,7 +286,7 @@ const menuButton = { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let fa = main.split(""); |
|
|
|
fa = main.split(""); |
|
|
|
let tail = ""; |
|
|
|
for(let i = fa.length-1; i >= 0; i--){ |
|
|
|
let c = fa[i]; |
|
|
|
@ -358,7 +358,9 @@ const menuButton = { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let prefix = "", main = ""; |
|
|
|
//Uncaught ReferenceError: Cannot access 'fa' before initialization
|
|
|
|
let prefix = "", main = "", fa = []; |
|
|
|
|
|
|
|
if(foucsStatus.fa.indexOf(".")>-1){ |
|
|
|
fa = foucsStatus.fa.split("."); |
|
|
|
prefix = fa[0]; |
|
|
|
@ -368,7 +370,7 @@ const menuButton = { |
|
|
|
main = foucsStatus.fa; |
|
|
|
} |
|
|
|
|
|
|
|
let fa = main.split(""); |
|
|
|
fa = main.split(""); |
|
|
|
let tail = ""; |
|
|
|
for(let i = fa.length - 1; i >= 0; i--){ |
|
|
|
let c = fa[i]; |
|
|
|
|
|
|
|
@ -8,4 +8,7 @@ if(window.addEventListener && (navigator.userAgent.indexOf("Firefox") > 0)){ |
|
|
|
__firefox(); |
|
|
|
} |
|
|
|
|
|
|
|
export default luckysheet; |
|
|
|
// export default luckysheet;
|
|
|
|
|
|
|
|
// use esbuild,bundle iife format
|
|
|
|
module.exports = luckysheet |