Skip to content

Commit fdb4d2d

Browse files
committed
restore old version
1 parent 6555bdb commit fdb4d2d

18 files changed

+254
-216
lines changed

.babelrc

-13
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,3 @@
33
"plugins": ["transform-runtime"],
44
"comments": false
55
}
6-
{
7-
"presets": [
8-
["@babel/preset-env", {
9-
"modules": false,
10-
"targets": {
11-
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
12-
}
13-
}]
14-
],
15-
"plugins": [
16-
"@babel/plugin-transform-runtime"
17-
]
18-
}

.circleci/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
- run:
77
name: Build an amd64 container image
88
command: |
9-
docker run -t --rm -v ${PWD}:/deploy-ui -w /deploy-ui node:22 bash -c "npm install && npm run build"
9+
docker run -t --rm -v ${PWD}:/deploy-ui -w /deploy-ui node:10.15 bash -c "npm install && npm run build"
1010
docker build -t wise2c/deploy-ui:amd64-$CIRCLE_BRANCH .
1111
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
1212
docker push wise2c/deploy-ui:amd64-$CIRCLE_BRANCH
@@ -18,7 +18,7 @@ jobs:
1818
- run:
1919
name: Build an amd64 container image
2020
command: |
21-
docker run -t --rm -v ${PWD}:/deploy-ui -w /deploy-ui node:22 bash -c "npm install && npm run build"
21+
docker run -t --rm -v ${PWD}:/deploy-ui -w /deploy-ui node:10.15 bash -c "npm install && npm run build"
2222
docker build -t wise2c/deploy-ui:amd64-$CIRCLE_TAG .
2323
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
2424
docker push wise2c/deploy-ui:amd64-$CIRCLE_TAG
@@ -31,7 +31,7 @@ jobs:
3131
- run:
3232
name: Build an aarch64 container image
3333
command: |
34-
docker run -t --rm -v ${PWD}:/deploy-ui -w /deploy-ui node:22 bash -c "npm install && npm run build"
34+
docker run -t --rm -v ${PWD}:/deploy-ui -w /deploy-ui node:10.15 bash -c "npm install && npm run build"
3535
docker build -t wise2c/deploy-ui:aarch64-$CIRCLE_BRANCH .
3636
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
3737
docker push wise2c/deploy-ui:aarch64-$CIRCLE_BRANCH
@@ -44,7 +44,7 @@ jobs:
4444
- run:
4545
name: Build an aarch64 container image
4646
command: |
47-
docker run -t --rm -v ${PWD}:/deploy-ui -w /deploy-ui node:22 bash -c "npm install && npm run build"
47+
docker run -t --rm -v ${PWD}:/deploy-ui -w /deploy-ui node:10.15 bash -c "npm install && npm run build"
4848
docker build -t wise2c/deploy-ui:aarch64-$CIRCLE_TAG .
4949
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
5050
docker push wise2c/deploy-ui:aarch64-$CIRCLE_TAG

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ test/e2e/reports
88
.idea
99
*.iml
1010
.vscode
11-
.aider*

build/build.js

+16-27
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,30 @@
1-
const path = require('path')
2-
const config = require('../config')
3-
const ora = require('ora')
4-
const webpack = require('webpack')
5-
const webpackConfig = require('./webpack.prod.conf')
1+
// https://github.com/shelljs/shelljs
2+
require('shelljs/global')
3+
env.NODE_ENV = 'production'
4+
5+
var path = require('path')
6+
var config = require('../config')
7+
var ora = require('ora')
8+
var webpack = require('webpack')
9+
var webpackConfig = require('./webpack.prod.conf')
610

711
console.log(
812
' Tip:\n' +
913
' Built files are meant to be served over an HTTP server.\n' +
1014
' Opening index.html over file:// won\'t work.\n'
1115
)
1216

13-
const spinner = ora('building for production...')
17+
var spinner = ora('building for production...')
1418
spinner.start()
1519

16-
const compiler = webpack(webpackConfig)
20+
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
21+
rm('-rf', assetsPath)
22+
mkdir('-p', assetsPath)
23+
cp('-R', 'static/', assetsPath)
1724

18-
compiler.run((err, stats) => {
25+
webpack(webpackConfig, function (err, stats) {
1926
spinner.stop()
20-
if (err) {
21-
console.error(err.stack || err)
22-
if (err.details) {
23-
console.error(err.details)
24-
}
25-
process.exit(1)
26-
}
27-
28-
const info = stats.toJson()
29-
30-
if (stats.hasErrors()) {
31-
console.error(info.errors)
32-
process.exit(1)
33-
}
34-
35-
if (stats.hasWarnings()) {
36-
console.warn(info.warnings)
37-
}
38-
27+
if (err) throw err
3928
process.stdout.write(stats.toString({
4029
colors: true,
4130
modules: false,

build/dev-server.js

+65-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,65 @@
1-
// This file is no longer needed as we're using webpack-dev-server directly
2-
// Configuration is now handled in webpack.dev.conf.js
1+
var path = require('path')
2+
var express = require('express')
3+
var webpack = require('webpack')
4+
var config = require('../config')
5+
var proxyMiddleware = require('http-proxy-middleware')
6+
var webpackConfig = process.env.NODE_ENV === 'testing'
7+
? require('./webpack.prod.conf')
8+
: require('./webpack.dev.conf')
9+
10+
// default port where dev server listens for incoming traffic
11+
var port = process.env.PORT || config.dev.port
12+
// Define HTTP proxies to your custom API backend
13+
// https://github.com/chimurai/http-proxy-middleware
14+
var proxyTable = config.dev.proxyTable
15+
16+
var app = express()
17+
var compiler = webpack(webpackConfig)
18+
19+
var devMiddleware = require('webpack-dev-middleware')(compiler, {
20+
publicPath: webpackConfig.output.publicPath,
21+
stats: {
22+
colors: true,
23+
chunks: false
24+
}
25+
})
26+
27+
var hotMiddleware = require('webpack-hot-middleware')(compiler)
28+
// force page reload when html-webpack-plugin template changes
29+
compiler.plugin('compilation', function (compilation) {
30+
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
31+
hotMiddleware.publish({ action: 'reload' })
32+
cb()
33+
})
34+
})
35+
36+
// proxy api requests
37+
Object.keys(proxyTable).forEach(function (context) {
38+
var options = proxyTable[context]
39+
if (typeof options === 'string') {
40+
options = { target: options }
41+
}
42+
app.use(proxyMiddleware(context, options))
43+
})
44+
45+
// handle fallback for HTML5 history API
46+
app.use(require('connect-history-api-fallback')())
47+
48+
// serve webpack bundle output
49+
app.use(devMiddleware)
50+
51+
// enable hot-reload and state-preserving
52+
// compilation error display
53+
app.use(hotMiddleware)
54+
55+
// serve pure static assets
56+
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
57+
app.use(staticPath, express.static('./static'))
58+
59+
module.exports = app.listen(port, function (err) {
60+
if (err) {
61+
console.log(err)
62+
return
63+
}
64+
console.log('Listening at http://localhost:' + port + '\n')
65+
})

build/utils.js

+4-9
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,22 @@ exports.cssLoaders = function (options) {
2222
return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
2323
}).join('!')
2424

25-
// Extract CSS when that option is specified
2625
if (options.extract) {
27-
return ExtractTextPlugin.extract({
28-
use: sourceLoader,
29-
fallback: 'vue-style-loader'
30-
})
26+
return ExtractTextPlugin.extract('vue-style-loader', sourceLoader)
3127
} else {
32-
return ['style-loader', sourceLoader].join('!')
28+
return ['vue-style-loader', sourceLoader].join('!')
3329
}
3430
}
3531

3632
// http://vuejs.github.io/vue-loader/configurations/extract-css.html
3733
return {
3834
css: generateLoaders(['css']),
39-
postcss: generateLoaders(['css', 'postcss']),
35+
postcss: generateLoaders(['css']),
4036
less: generateLoaders(['css', 'less']),
4137
sass: generateLoaders(['css', 'sass?indentedSyntax']),
4238
scss: generateLoaders(['css', 'sass']),
4339
stylus: generateLoaders(['css', 'stylus']),
44-
styl: generateLoaders(['css', 'stylus']),
45-
font: generateLoaders(['file-loader'])
40+
styl: generateLoaders(['css', 'stylus'])
4641
}
4742
}
4843

build/webpack.base.conf.js

+38-51
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
const path = require('path')
2-
const config = require('../config')
3-
const utils = require('./utils')
4-
const projectRoot = path.resolve(__dirname, '../')
5-
const TerserPlugin = require('terser-webpack-plugin')
6-
const { VueLoaderPlugin } = require('vue-loader')
1+
var path = require('path')
2+
var config = require('../config')
3+
var utils = require('./utils')
4+
var projectRoot = path.resolve(__dirname, '../')
75

86
module.exports = {
9-
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
107
entry: {
118
app: './src/main.js'
129
},
@@ -34,79 +31,69 @@ module.exports = {
3431
fallback: [path.join(__dirname, '../node_modules')]
3532
},
3633
module: {
37-
noParse: /.npminstall\/localforage\/1.4.3\/localforage\/dist\/localforage.js/,
38-
rules: [
34+
noParse: /.npminstall\/localforage\/1.4.3\/localforage\/dist\/localforage.js/,
35+
preLoaders: [
3936
{
4037
test: /\.vue$/,
41-
loader: 'vue-loader'
38+
loader: 'eslint',
39+
include: projectRoot,
40+
exclude: /node_modules/
41+
},
42+
{
43+
test: /\.js$/,
44+
loader: 'eslint',
45+
include: projectRoot,
46+
exclude: /node_modules/
47+
}
48+
],
49+
loaders: [
50+
// {
51+
// test: require.resolve('jsplumb'),
52+
// loaders: [
53+
// 'imports?this=>window',
54+
// 'script'
55+
// ]
56+
// },
57+
{
58+
test: /\.vue$/,
59+
loader: 'vue'
4260
},
4361
{
4462
test: /\.js$/,
45-
loader: 'babel-loader',
63+
loader: 'babel',
4664
include: projectRoot,
4765
exclude: /node_modules/
4866
},
4967
{
5068
test: /\.json$/,
51-
type: 'json'
69+
loader: 'json'
5270
},
5371
{
5472
test: /\.html$/,
55-
loader: 'vue-html-loader'
73+
loader: 'vue-html'
5674
},
5775
{
5876
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
59-
loader: 'url-loader',
60-
options: {
77+
loader: 'url',
78+
query: {
6179
limit: 10000,
6280
name: utils.assetsPath('img/[name].[hash:7].[ext]')
6381
}
6482
},
6583
{
6684
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
67-
loader: 'url-loader',
68-
options: {
85+
loader: 'url',
86+
query: {
6987
limit: 10000,
7088
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
7189
}
72-
},
73-
{
74-
test: /\.css$/,
75-
use: [
76-
'style-loader',
77-
{
78-
loader: 'css-loader',
79-
options: {
80-
sourceMap: process.env.NODE_ENV === 'production' ?
81-
config.build.productionSourceMap :
82-
config.dev.cssSourceMap
83-
}
84-
}
85-
]
8690
}
8791
]
8892
},
8993
eslint: {
9094
formatter: require('eslint-friendly-formatter')
9195
},
92-
optimization: {
93-
minimize: process.env.NODE_ENV === 'production',
94-
minimizer: [
95-
new TerserPlugin({
96-
terserOptions: {
97-
compress: {
98-
warnings: false
99-
},
100-
output: {
101-
comments: false
102-
},
103-
sourceMap: config.build.productionSourceMap
104-
},
105-
parallel: true
106-
})
107-
]
108-
},
109-
plugins: [
110-
new VueLoaderPlugin()
111-
]
96+
vue: {
97+
loaders: utils.cssLoaders()
98+
}
11299
}

build/webpack.dev.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Object.keys(baseWebpackConfig.entry).forEach(function (name) {
1212

1313
module.exports = merge(baseWebpackConfig, {
1414
module: {
15-
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
15+
loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
1616
},
1717
// eval-source-map is faster for development
1818
devtool: '#eval-source-map',

0 commit comments

Comments
 (0)