Commit 00a8c7b0 by chenyu

Merge branch 'feature/eslint改造计划' of http://git.gicdev.com/integralMall/integral-mall into dev

parents e0a45858 7b3a08dc
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": "2",
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]
],
"@vue/babel-preset-jsx"
]
}
.DS_Store
node_modules/
/build/
/config/
/dist/
/*.js
/node_modules/
/static/
/**/assets/
node_modules/*
.idea
*.idea
.DS_Store
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit "$1"
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
......@@ -4,7 +4,6 @@ module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
# y
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
- 在项目根目录中使用node命令执行exec.js文件路径
- 修改config/index.js中的publicpath为当前项目名
- 删除node_modules文件夹重新 npm install
- 执行npm run lint校验代码
'use strict'
require('./check-versions')()
'use strict';
require('./check-versions')();
process.env.NODE_ENV = 'production'
process.env.NODE_ENV = 'production';
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const ora = require('ora');
const chalk = require('chalk');
const webpack = require('webpack');
const webpackConfig = require('./webpack.prod.conf');
const spinner = ora('building for production...')
spinner.start()
const spinner = ora('building for production...');
spinner.start();
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
webpack(webpackConfig, (err, stats) => {
spinner.stop();
if (err) throw err;
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false,
}) + '\n\n');
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'));
process.exit(1);
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
console.log(chalk.cyan(' Build complete.\n'));
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n',
));
});
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
'use strict';
const chalk = require('chalk');
const semver = require('semver');
const packageConfig = require('../package.json');
const shell = require('shelljs');
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
return require('child_process').execSync(cmd).toString().trim();
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
versionRequirement: packageConfig.engines.node,
},
];
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
versionRequirement: packageConfig.engines.npm,
});
}
module.exports = function () {
const warnings = []
const warnings = [];
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
const mod = versionRequirements[i];
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
chalk.green(mod.versionRequirement),
);
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
console.log('');
console.log(chalk.yellow('To use this template, you must update following to modules:'));
console.log();
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
const warning = warnings[i];
console.log(' ' + warning);
}
console.log()
process.exit(1)
console.log();
process.exit(1);
}
}
};
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
'use strict';
const path = require('path');
const packageConfig = require('../package.json');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const fs = require('fs');
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoaders = function () {
const sourceMap = process.env.NODE_ENV === 'production';
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
sourceMap,
},
};
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
sourceMap,
},
};
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
const loaders = [cssLoader, postcssLoader];
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
sourceMap,
}),
});
}
return [process.env.NODE_ENV === 'production' ? MiniCssExtractPlugin.loader : 'style-loader'].concat(loaders);
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
sass: generateLoaders('sass', { sassOptions: { indentedSyntax: true } }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
styl: generateLoaders('stylus'),
};
};
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
exports.styleLoaders = function () {
const output = [];
const loaders = cssLoaders();
for (const extension in loaders) {
const loader = loaders[extension]
const loader = loaders[extension];
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
use: loader,
});
}
return output
}
return output;
};
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
const notifier = require('node-notifier');
return (severity, errors) => {
if (severity !== 'error') return
if (severity !== 'error') return;
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
const error = errors[0];
const filename = error.file && error.file.split('!').pop();
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}
icon: path.join(__dirname, 'logo.png'),
});
};
};
exports.envs = function () {
const env = path.join(__dirname, '../.env');
const envFiles = [
`${env}.${process.env.NODE_ENV}`,
`${env}`,
];
envFiles.forEach((path) => {
if (fs.existsSync(path)) {
require('dotenv-expand')(
require('dotenv').config({
path,
}),
);
}
});
const reg = /^DAMO_APP_/;
const stringified = Object.keys(process.env)
.filter((key) => reg.test(key))
.reduce((env, key) => {
env[`process.env.${key}`] = JSON.stringify(process.env[key]);
return env;
}, {});
console.log(stringified);
return stringified;
};
exports.hasFile = function (dir) {
let result = false;
if (!fs.existsSync(dir)) return false;
const paths = fs.readdirSync(path.resolve(dir));
if (paths.length === 0) return false;
paths.forEach(el => {
const _src = path.join(dir, el);
const stats = fs.statSync(_src);
if (stats.isFile()) {
result = true;
} else if (stats.isDirectory()) {
result = exports.hasFile(_src);
}
});
return result;
};
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
'use strict';
const path = require('path');
const utils = require('./utils');
const { VueLoaderPlugin } = require('vue-loader');
const ESLintPlugin = require('eslint-webpack-plugin');
const config = require('../config');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
function resolve (dir) {
return path.join(__dirname, '..', dir)
return path.join(__dirname, '..', dir);
}
const createLintingRule = () => ({
test: /\.(js|vue)$/,
loader: "eslint-loader",
enforce: "pre",
include: [resolve("src"), resolve("test")],
options: {
fix: true,
formatter: require("eslint-friendly-formatter"),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
});
const { outputDir = 'dist', publicPath = '/' } = config;
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
entry: ['./src/main.js'],
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
},
output: {
path: path.resolve(__dirname, '..', outputDir),
filename: 'js/[name].[chunkhash].js',
chunkFilename: 'js/[name].[chunkhash].js',
publicPath: publicPath,
clean: true,
},
module: {
rules: [
...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'),resolve('static'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
include: [resolve('src')],
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
type: 'asset',
generator: {
filename: 'img/[name].[hash:7].[ext]',
},
parser: {
dataUrlCondition: {
maxSize: 10000,
},
},
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
type: 'asset',
generator: {
filename: 'media/[name].[hash:7].[ext]',
},
parser: {
dataUrlCondition: {
maxSize: 10000,
},
},
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
type: 'asset',
generator: {
filename: 'fonts/[name].[hash:7].[ext]',
},
parser: {
dataUrlCondition: {
maxSize: 10000,
},
},
},
...utils.styleLoaders(),
],
},
externals: {
'vue': 'Vue',
vue: 'Vue',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'element-ui': 'ELEMENT'
vuex: 'Vuex',
axios: 'axios',
'element-ui': 'ELEMENT',
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}
plugins: [
new VueLoaderPlugin(),
new ESLintPlugin({
extensions: ['js', 'vue'],
files: 'src',
fix: true,
lintDirtyModulesOnly: true,
exclude: ['assets'],
formatter: 'visualstudio',
}),
new HtmlWebpackPlugin({
template: 'index.html',
}),
new webpack.DefinePlugin({
...utils.envs(),
}),
],
stats: 'errors-only',
};
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
'use strict';
process.env.NODE_ENV = 'development';
const utils = require('./utils');
const config = require('../config');
const { merge } = require('webpack-merge');
const path = require('path');
const baseWebpackConfig = require('./webpack.base.conf');
const FriendlyErrorsPlugin = require('@soda/friendly-errors-webpack-plugin');
const portfinder = require('portfinder');
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const { port = '8080', publicPath = '/', devServerProxy } = config;
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
mode: 'development',
devtool: 'eval-source-map',
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
client: {
logging: 'warn',
overlay: true,
progress: true,
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
devMiddleware: {
publicPath: publicPath,
},
onBeforeSetupMiddleware: function (devServer) {
if (!devServer) {
throw new Error('webpack-dev-server is not defined');
}
devServer.app.get('/', function (req, res) {
res.redirect(publicPath);
});
},
before(app) {
app.get('/', (req, res) => {
res.redirect('/integral-mall/');
})
static: {
directory: path.join(__dirname, '../static'),
publicPath: path.posix.join(publicPath, 'static'),
},
historyApiFallback: {
rewrites: [{ from: /.*/, to: path.posix.join(publicPath, 'index.html') }],
},
host: 'localhost',
port: port,
open: false,
proxy: devServerProxy,
watchFiles: {
options: {
usePolling: false,
},
},
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
});
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.basePort = port;
portfinder.getPort((err, port) => {
if (err) {
reject(err)
reject(err);
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
devWebpackConfig.devServer.port = port;
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
devWebpackConfig.plugins.push(
new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://localhost:${port}`],
},
onErrors: utils.createNotifierCallback(),
}),
);
resolve(devWebpackConfig)
resolve(devWebpackConfig);
}
})
})
});
});
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
'use strict';
const path = require('path');
const utils = require('./utils');
const webpack = require('webpack');
const config = require('../config');
const { merge } = require('webpack-merge');
const baseWebpackConfig = require('./webpack.base.conf');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const env = require('../config/prod.env')
const { outputDir = 'dist', productionGzip = false } = config;
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
publicPath:'./',
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
mode: 'production',
devtool: false,
optimization: {
minimizer: [
'...',
new CssMinimizerPlugin(),
],
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
new MiniCssExtractPlugin({
filename: 'css/[name].[contenthash].css',
}),
new webpack.ids.HashedModuleIdsPlugin(),
],
});
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
const staticPath = path.resolve(__dirname, '../static');
if (utils.hasFile(staticPath)) {
webpackConfig.plugins.push(
new CopyWebpackPlugin({
patterns: [
{
from: staticPath,
to: path.resolve(__dirname, '..', outputDir, 'static'),
info: { minimized: true },
globOptions: {
ignore: ['.*'],
},
},
],
}),
);
}
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
if (productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin');
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
filename: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
threshold: 10240,
minRatio: 0.8
})
)
minRatio: 0.8,
}),
);
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
if (process.env.npm_config_report) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
}
module.exports = webpackConfig
module.exports = webpackConfig;
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', ['update', 'feat', 'fix', 'refactor', 'docs', 'chore', 'style', 'revert', 'build']],
},
};
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
'use strict';
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/integral-mall',
// proxyTable: {},
proxyTable: {
'/api/': {
target: 'http://gicdev.demogic.com',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
},
'/api-auth/': {
target: 'http://gicdev.demogic.com/api-auth/',
changeOrigin: true,
pathRewrite: {
'^/api-auth': ''
}
}
publicPath: '/integral-mall/',
devServerProxy: {
'/api-.*/': {
target: 'http://gicdev.demogic.com',
changeOrigin: true,
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8002, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
/**
* Source Maps
*/
productionSourceMap: false,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}
};
<<<<<<< HEAD
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.a98e3d3bf1798dc56a5d2a8c4d3430e1.css rel=stylesheet></head><body><div id=app></div><script>(function() {
=======
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.dc108639350c1865924c9c92683ce2a9.css rel=stylesheet></head><body><div id=app></div><script>(function() {
>>>>>>> 7b3a08dc74f22be397bdb4eb16bdd568214382a6
var src = '/component/static/import-component.js?timestrap=' + new Date().getTime();
var host = window.location.host;
host = host.indexOf('localhost') > -1 || host.indexOf('192.168') > -1 ? 'gicdev.demogic.com' : host;
document.write('<script src="//' + host + src + '"><\/script>');
})();</script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.242a74965f304ce7e306.js></script><script type=text/javascript src=./static/js/app.86549a9a4822214e148d.js></script></body></html>
\ No newline at end of file
<<<<<<< HEAD
})();</script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.242a74965f304ce7e306.js></script><script type=text/javascript src=./static/js/app.86549a9a4822214e148d.js></script></body></html>
=======
})();</script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.242a74965f304ce7e306.js></script><script type=text/javascript src=./static/js/app.dd687562d4aa3f10b0a6.js></script></body></html>
>>>>>>> 7b3a08dc74f22be397bdb4eb16bdd568214382a6
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
module.exports = {
'src/**/*.{js,vue}': 'eslint --ext .js --ext .vue --ext src/',
};
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "y",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "dmg",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js",
"format": "onchange 'test/**/*.js' 'src/**/*.js' 'src/**/*.vue' -- prettier --write {{changed}}",
"formater": "onchange \"test/**/*.js\" \"src/**/*.js\" \"src/**/*.vue\" -- prettier --write {{changed}}"
},
"dependencies": {
"@riophae/vue-treeselect": "0.0.35",
"@tinymce/tinymce-vue": "^1.0.8",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"element-ui": "^2.15.6",
"es6-promise": "^4.2.6",
"less": "^3.0.4",
"less-loader": "^4.1.0",
"tinymce": "^4.8.2",
"vue": "2.6.6",
"vue-axios": "^2.1.1",
"vue-clipboard2": "^0.2.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^8.2.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-prettier": "^3.6.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"node-sass": "^4.12.0",
"onchange": "^5.2.0",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"prettier": "^1.16.4",
"rimraf": "^2.6.0",
"sass-loader": "^8.0.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "2.6.6",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.7",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
"name": "gic",
"description": "damo project",
"author": "damo",
"private": true,
"scripts": {
"dev": "webpack server --progress --config build/webpack.dev.conf.js",
"build": "node build/build.js",
"lint": "eslint --ext .js --ext .vue src/ --fix",
"prepare": "husky install"
},
"devDependencies": {
"@babel/core": "7.16.0",
"@babel/eslint-parser": "7.16.3",
"@babel/preset-env": "7.16.0",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"@soda/friendly-errors-webpack-plugin": "^1.8.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
"@vue/babel-preset-jsx": "^1.2.4",
"autoprefixer": "10.4.0",
"babel-loader": "8.2.3",
"chalk": "4.1.2",
"copy-webpack-plugin": "9.0.1",
"css-loader": "6.5.1",
"css-minimizer-webpack-plugin": "3.1.3",
"dotenv": "10.0.0",
"dotenv-expand": "5.1.0",
"eslint": "8.2.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-vue": "^8.0.3",
"eslint-webpack-plugin": "^3.1.1",
"html-webpack-plugin": "5.5.0",
"husky": "^7.0.0",
"lint-staged": "^12.0.2",
"mini-css-extract-plugin": "2.4.4",
"node-notifier": "10.0.0",
"node-sass": "4.14.1",
"ora": "^5.4.1",
"portfinder": "^1.0.27",
"postcss": "8.3.11",
"postcss-import": "^14.0.2",
"postcss-loader": "6.2.0",
"postcss-url": "^10.1.3",
"sass-loader": "^7.0.3",
"semver": "7.3.5",
"shelljs": "0.8.4",
"style-loader": "3.3.1",
"vue-eslint-parser": "^8.0.1",
"vue-loader": "15.9.8",
"vue-template-compiler": "2.6.6",
"webpack": "5.56.0",
"webpack-bundle-analyzer": "4.5.0",
"webpack-cli": "4.9.1",
"webpack-dev-server": "4.3.0",
"webpack-merge": "5.8.0"
},
"optionalDependencies": {
"fsevents": "*"
},
"engines": {
"node": ">= 12.22.0",
"npm": ">= 6.14.11"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"dependencies": {
"@riophae/vue-treeselect": "0.0.35",
"@tinymce/tinymce-vue": "^1.0.8",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"element-ui": "^2.4.0",
"es6-promise": "^4.2.6",
"less": "^3.0.4",
"less-loader": "^4.1.0",
"tinymce": "^4.8.2",
"vue": "2.6.6",
"vue-axios": "^2.1.1",
"vue-clipboard2": "^0.2.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.0.1"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment