Skip to content

Commit 1e19fa0

Browse files
committed
1.automatic packaging into ZIP packages;
2.add shell scripts when packing
1 parent c12d2a6 commit 1e19fa0

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"eslint-config-google": "^0.13.0",
4141
"eslint-plugin-prettier": "^3.1.0",
4242
"eslint-plugin-vue": "^5.0.0",
43+
"filemanager-webpack-plugin": "^2.0.5",
4344
"monaco-editor-webpack-plugin": "^1.7.0",
4445
"node-sass": "^4.9.0",
4546
"sass-loader": "^7.1.0",

src/js/component/editor/editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export default {
391391
let isParseSuccess = true;
392392
if (lang === 'hql') {
393393
const val = value || vm.value;
394-
const validParser = vm.isParserClose ? null : sqlParser.parser.parseSyntax(val, 'hive');
394+
const validParser = vm.isParserClose ? null : parser.parseSyntax(val, 'hive');
395395
let newDecora = [];
396396
if (validParser) {
397397
isParseSuccess = false;

vue.config.js

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,37 @@
11
// vue.config.js
22
let CopyWebpackPlugin = require('copy-webpack-plugin')
3+
let FileManagerPlugin = require('filemanager-webpack-plugin');
34
let path = require('path')
5+
let fs = require('fs');
6+
7+
const getVersion = () => {
8+
const pkgPath = path.join(__dirname, './package.json');
9+
let pkg = fs.readFileSync(pkgPath);
10+
pkg = JSON.parse(pkg);
11+
return pkg.version;
12+
}
13+
414
module.exports = {
15+
outputDir: 'dist/dist',
16+
chainWebpack: (config) => {
17+
if (process.env.NODE_ENV === 'production') {
18+
config.plugin('compress').use(FileManagerPlugin, [{
19+
onEnd: {
20+
copy: [
21+
{ source: 'node_modules/monaco-editor/dev/vs', destination: `./dist/dist/static/vs` },
22+
{ source: './config.sh', destination: `./dist` },
23+
{ source: './install.sh', destination: `./dist` }
24+
],
25+
// 先删除根目录下的zip包
26+
delete: [`./wedatasphere-scriptis-${getVersion()}-dist.zip`],
27+
// 将dist文件夹下的文件进行打包
28+
archive: [
29+
{ source: './dist', destination: `./wedatasphere-scriptis-${getVersion()}-dist.zip` },
30+
]
31+
},
32+
}])
33+
}
34+
},
535
configureWebpack: {
636
resolve: {
737
alias: {
@@ -12,8 +42,6 @@ module.exports = {
1242
}
1343
},
1444
plugins: [
15-
// 忽略moment的locale文件夹,然后再main.js中手动加载 ‘moment/locale/zh-cn'
16-
// new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
1745
new CopyWebpackPlugin([{
1846
from: 'node_modules/monaco-editor/dev/vs',
1947
to: 'static/vs',
@@ -27,4 +55,4 @@ module.exports = {
2755
power: false
2856
}
2957
}
30-
}
58+
}

0 commit comments

Comments
 (0)