Commit 9eb8c1c3 by luojie

update: eslint

parent fbb9e7f2
...@@ -4,12 +4,21 @@ module.exports = { ...@@ -4,12 +4,21 @@ module.exports = {
root: true, root: true,
parser: "vue-eslint-parser", parser: "vue-eslint-parser",
parserOptions: { parserOptions: {
parser: '@babel/eslint-parser' parser: '@babel/eslint-parser',
ecmaVersion: 2021,
ecmaFeatures: {
jsx: true
}
}, },
env: { env: {
browser: true, browser: true,
"node": true node: true
}, },
extends: [
'standard',
'plugin:vue/recommended'
],
plugins: ['vue'],
// add your custom rules here // add your custom rules here
rules: { rules: {
// 'prettier/prettier': [ // 'prettier/prettier': [
......
'use strict' 'use strict'
require('./check-versions')() require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora') const ora = require('ora')
const chalk = require('chalk') const chalk = require('chalk')
const webpack = require('webpack') const webpack = require('webpack')
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
const path = require('path'); const path = require('path');
module.exports = { module.exports = {
outputDir: '/dist3', outputDir: 'dist3',
publicPath: '/marketing', publicPath: 'marketing',
productionGzip: false, productionGzip: false,
devServerProxy: { devServerProxy: {
'/api-.*/': { '/api-.*/': {
......
...@@ -7,7 +7,7 @@ exports.assetsPath = function(_path) { ...@@ -7,7 +7,7 @@ exports.assetsPath = function(_path) {
return path.posix.join('static', _path); return path.posix.join('static', _path);
}; };
const cssLoaders = function() { const cssLoaders = function () {
const sourceMap = process.env.NODE_ENV === 'production' ? false : true const sourceMap = process.env.NODE_ENV === 'production' ? false : true
......
...@@ -23,8 +23,8 @@ module.exports = { ...@@ -23,8 +23,8 @@ module.exports = {
}, },
output: { output: {
path: path.resolve(__dirname, '..', outputDir), path: path.resolve(__dirname, '..', outputDir),
filename: utils.assetsPath('js/[name].[chunkhash].js'), filename: 'js/[name].[chunkhash].js',
chunkFilename: utils.assetsPath('js/[name].[chunkhash].js'), chunkFilename: 'js/[name].[chunkhash].js',
publicPath: publicPath, publicPath: publicPath,
clean: true clean: true
}, },
...@@ -87,11 +87,11 @@ module.exports = { ...@@ -87,11 +87,11 @@ module.exports = {
}, },
plugins: [ plugins: [
new VueLoaderPlugin(), new VueLoaderPlugin(),
// new ESLintPlugin({ new ESLintPlugin({
// extensions: ['js', 'vue'], extensions: ['js', 'vue'],
// files: 'src', files: 'src',
// fix: true fix: true
// }), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: 'index.html', template: 'index.html',
}) })
......
...@@ -22,15 +22,14 @@ const webpackConfig = merge(baseWebpackConfig, { ...@@ -22,15 +22,14 @@ const webpackConfig = merge(baseWebpackConfig, {
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'), filename: 'css/[name].[contenthash].css'
}), }),
new webpack.ids.HashedModuleIdsPlugin(), new webpack.ids.HashedModuleIdsPlugin(),
new CopyWebpackPlugin({ new CopyWebpackPlugin({
patterns: [ patterns: [
{ {
from: path.resolve(__dirname, '../static'), from: path.resolve(__dirname, '../static'),
to: path.resolve(__dirname, '..', outputDir), to: path.resolve(__dirname, '..', outputDir, 'static'),
info: { minimized: true }, info: { minimized: true },
globOptions: { globOptions: {
ignore: ['.*'] ignore: ['.*']
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"author": "", "author": "",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "webpack server --progress --config build/webpack.dev.conf.js", "dev": "webpack server --env NODE_ENV=development --progress --config build/webpack.dev.conf.js",
"start": "npm run dev", "start": "npm run dev",
"build": "node build/build.js", "build": "node build/build.js",
"format": "onchange 'test/**/*.js' 'src/**/*.js' 'src/**/*.vue' -- prettier --write {{changed}}" "format": "onchange 'test/**/*.js' 'src/**/*.js' 'src/**/*.vue' -- prettier --write {{changed}}"
...@@ -51,6 +51,11 @@ ...@@ -51,6 +51,11 @@
"css-loader": "6.5.1", "css-loader": "6.5.1",
"css-minimizer-webpack-plugin": "3.1.3", "css-minimizer-webpack-plugin": "3.1.3",
"eslint": "8.2.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", "eslint-webpack-plugin": "^3.1.1",
"html-webpack-plugin": "5.5.0", "html-webpack-plugin": "5.5.0",
"mini-css-extract-plugin": "2.4.4", "mini-css-extract-plugin": "2.4.4",
......
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