提交 fa409444 编写于 作者: P Peter Pan

feat: support changing public path when start

上级 1bb56cfc
......@@ -7,10 +7,9 @@ const {spawn} = require('child_process');
const {writeFileSync} = require('fs');
const next = require.resolve('next/dist/bin/next');
const projectRoot = path.dirname(require.resolve('@visualdl/core'));
module.exports.projectRoot = path.dirname(require.resolve('@visualdl/core'));
module.exports.default = function (action, ...args) {
module.exports = function (action, ...args) {
return new Promise((resolve, reject) => {
const capitalizedAction = action.replace(/^./, w => w.toUpperCase());
......@@ -42,3 +41,5 @@ module.exports.default = function (action, ...args) {
});
});
};
module.exports.projectRoot = projectRoot;
......@@ -31,12 +31,31 @@
"test": "echo \"Error: no test specified\" && exit 0"
},
"dependencies": {
"@babel/core": "7.9.6",
"@types/d3": "5.7.2",
"@types/dagre-d3": "0.4.39",
"@types/echarts": "4.6.0",
"@types/file-saver": "2.0.1",
"@types/lodash": "4.14.150",
"@types/mime-types": "2.1.0",
"@types/node": "13.13.5",
"@types/nprogress": "0.2.0",
"@types/react-dom": "16.9.7",
"@types/react": "16.9.34",
"@types/styled-components": "5.1.0",
"@visualdl/i18n": "2.0.0-beta.36",
"@visualdl/mock": "2.0.0-beta.36",
"@visualdl/wasm": "2.0.0-beta.36",
"babel-plugin-emotion": "10.0.33",
"babel-plugin-styled-components": "1.10.7",
"babel-plugin-typescript-to-proptypes": "1.3.2",
"bignumber.js": "9.0.0",
"core-js": "3.6.5",
"cross-env": "7.0.2",
"css-loader": "3.5.3",
"dagre-d3": "0.6.4",
"echarts": "4.7.0",
"echarts-gl": "1.1.1",
"echarts": "4.7.0",
"eventemitter3": "4.0.0",
"file-saver": "2.0.2",
"isomorphic-unfetch": "3.0.0",
......@@ -46,41 +65,20 @@
"nanoid": "3.1.5",
"next": "9.3.6",
"nprogress": "0.2.0",
"ora": "4.0.4",
"polished": "3.6.2",
"prop-types": "15.7.2",
"query-string": "6.12.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-hooks-worker": "0.9.0",
"react-input-range": "1.3.0",
"react-is": "16.13.1",
"react-spinners": "0.8.3",
"react-tooltip": "4.2.6",
"react": "16.13.1",
"save-svg-as-png": "1.4.17",
"styled-components": "5.1.0",
"swr": "0.2.0"
},
"devDependencies": {
"@babel/core": "7.9.6",
"@types/d3": "5.7.2",
"@types/dagre-d3": "0.4.39",
"@types/echarts": "4.6.0",
"@types/file-saver": "2.0.1",
"@types/lodash": "4.14.150",
"@types/mime-types": "2.1.0",
"@types/node": "13.13.5",
"@types/nprogress": "0.2.0",
"@types/react": "16.9.34",
"@types/react-dom": "16.9.7",
"@types/styled-components": "5.1.0",
"@visualdl/mock": "2.0.0-beta.36",
"babel-plugin-emotion": "10.0.33",
"babel-plugin-styled-components": "1.10.7",
"babel-plugin-typescript-to-proptypes": "1.3.2",
"core-js": "3.6.5",
"cross-env": "7.0.2",
"css-loader": "3.5.3",
"ora": "4.0.4",
"swr": "0.2.0",
"typescript": "3.8.3",
"worker-plugin": "4.0.3"
},
......
......@@ -28,7 +28,11 @@ async function start() {
await builder('build');
await builder('export', '-o', dist);
} catch (e) {
process.exit(e);
if ('number' === typeof e) {
process.exit(e);
}
console.error(e);
process.exit(1);
}
process.exit(0);
}
......
......@@ -29,7 +29,7 @@ build_frontend() {
npm install --no-package-lock
npm run build
cp -a dist/. "$BUILD_DIR/package/dist/"
cp -a "$FRONTEND_DIR/packages/serverless/dist/." "$BUILD_DIR/package/dist/"
}
clean_env() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册