Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit 324eeff

Browse files
committed
fix: more old code
1 parent 7400848 commit 324eeff

File tree

9 files changed

+43
-37
lines changed

9 files changed

+43
-37
lines changed
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
var merge = require('webpack-merge')
2-
var prodEnv = require('./prod.env')
1+
/* eslint-disable import/no-commonjs */
2+
3+
const merge = require('webpack-merge');
4+
const prodEnv = require('./prod.env');
35

46
module.exports = merge(prodEnv, {
5-
NODE_ENV: '"development"'
6-
})
7+
NODE_ENV: '"development"',
8+
});

examples/e-commerce/config/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable import/no-commonjs */
2+
13
// see http://vuejs-templates.github.io/webpack for documentation.
2-
var path = require('path')
4+
const path = require('path');
35

46
module.exports = {
57
build: {
@@ -19,7 +21,7 @@ module.exports = {
1921
// View the bundle analyzer report after build finishes:
2022
// `npm run build --report`
2123
// Set to `true` or `false` to always turn it on or off
22-
bundleAnalyzerReport: process.env.npm_config_report
24+
bundleAnalyzerReport: process.env.npm_config_report,
2325
},
2426
dev: {
2527
env: require('./dev.env'),
@@ -33,6 +35,6 @@ module.exports = {
3335
// (https://github.com/webpack/css-loader#sourcemaps)
3436
// In our experience, they generally work as expected,
3537
// just be aware of this issue when enabling this option.
36-
cssSourceMap: false
37-
}
38-
}
38+
cssSourceMap: false,
39+
},
40+
};
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-commonjs */
12
module.exports = {
2-
NODE_ENV: '"production"'
3-
}
3+
NODE_ENV: '"production"',
4+
};

examples/multi-index/src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Plugin from 'vue-instantsearch';
44

55
Vue.use(Plugin);
66

7+
// eslint-disable-next-line no-new
78
new Vue({
89
el: '#app',
910
render: h => h(App),

examples/ssr/build/webpack.base.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
/* eslint-disable import/no-commonjs */
12
const path = require('path');
2-
const webpack = require('webpack');
33

44
module.exports = {
55
devtool: '#cheap-module-source-map',
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
const webpack = require('webpack')
2-
const merge = require('webpack-merge')
3-
const baseConfig = require('./webpack.base.config.js')
4-
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin')
1+
/* eslint-disable import/no-commonjs */
2+
const webpack = require('webpack');
3+
const merge = require('webpack-merge');
4+
const baseConfig = require('./webpack.base.config.js');
5+
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin');
56

67
module.exports = merge(baseConfig, {
78
entry: './src/main.client.js',
@@ -10,11 +11,11 @@ module.exports = merge(baseConfig, {
1011
// so that async chunks can be injected right after it.
1112
// this also enables better caching for your app/vendor code.
1213
new webpack.optimize.CommonsChunkPlugin({
13-
name: "manifest",
14-
minChunks: Infinity
14+
name: 'manifest',
15+
minChunks: Infinity,
1516
}),
1617
// This plugins generates `vue-ssr-client-manifest.json` in the
1718
// output directory.
18-
new VueSSRClientPlugin()
19-
]
20-
})
19+
new VueSSRClientPlugin(),
20+
],
21+
});

examples/ssr/build/webpack.server.config.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
const merge = require('webpack-merge')
2-
const nodeExternals = require('webpack-node-externals')
3-
const baseConfig = require('./webpack.base.config.js')
4-
const VueSSRServerPlugin = require('vue-server-renderer/server-plugin')
1+
/* eslint-disable import/no-commonjs */
2+
const merge = require('webpack-merge');
3+
const nodeExternals = require('webpack-node-externals');
4+
const baseConfig = require('./webpack.base.config.js');
5+
const VueSSRServerPlugin = require('vue-server-renderer/server-plugin');
56

67
module.exports = merge(baseConfig, {
78
// Point entry to your app's server entry file
@@ -17,7 +18,7 @@ module.exports = merge(baseConfig, {
1718

1819
// This tells the server bundle to use Node-style exports
1920
output: {
20-
libraryTarget: 'commonjs2'
21+
libraryTarget: 'commonjs2',
2122
},
2223

2324
// https://webpack.js.org/configuration/externals/#function
@@ -28,13 +29,11 @@ module.exports = merge(baseConfig, {
2829
// do not externalize dependencies that need to be processed by webpack.
2930
// you can add more file types here e.g. raw *.vue files
3031
// you should also whitelist deps that modifies `global` (e.g. polyfills)
31-
whitelist: /\.css$/
32+
whitelist: /\.css$/,
3233
}),
3334

3435
// This is the plugin that turns the entire output of the server build
3536
// into a single JSON file. The default file name will be
3637
// `vue-ssr-server-bundle.json`
37-
plugins: [
38-
new VueSSRServerPlugin()
39-
]
40-
})
38+
plugins: [new VueSSRServerPlugin()],
39+
});

examples/ssr/src/main.client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { createApp } from './main'
1+
import { createApp } from './main';
22

33
// client-specific bootstrapping logic...
44

5-
const { app } = createApp()
5+
const { app } = createApp();
66

77
// this assumes App.vue template root element has id="app"
8-
app.$mount('#app')
8+
app.$mount('#app');

examples/ssr/src/main.server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { createApp } from './main';
22

3-
export default context => {
3+
export default context =>
44
// since there could potentially be asynchronous route hooks or components,
55
// we will be returning a Promise so that the server can wait until
66
// everything is ready before rendering.
7-
return new Promise((resolve, reject) => {
7+
new Promise((resolve, reject) => {
88
const { app, router } = createApp();
99

1010
// set server-side router's location
@@ -15,6 +15,7 @@ export default context => {
1515
const matchedComponents = router.getMatchedComponents();
1616
// no matched routes, reject with 404
1717
if (!matchedComponents.length) {
18+
// eslint-disable-next-line prefer-promise-reject-errors
1819
reject({ code: 404, context });
1920
}
2021

@@ -35,4 +36,3 @@ export default context => {
3536
.catch(reject);
3637
}, reject);
3738
});
38-
};

0 commit comments

Comments
 (0)