chore: client linting #242
This commit is contained in:
parent
259f4f0afe
commit
0ff37bc834
5 changed files with 36 additions and 32 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import * as io from 'socket.io-client/dist/socket.io.js';
|
import * as io from 'socket.io-client/dist/socket.io.js';
|
||||||
import { Terminal } from 'xterm';
|
import { Terminal } from 'xterm';
|
||||||
import { FitAddon } from 'xterm-addon-fit';
|
import { FitAddon } from 'xterm-addon-fit';
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,31 @@
|
||||||
const path = require('path')
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
|
const path = require('path');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
context: path.resolve('__dirname', '../'),
|
context: path.resolve('__dirname', '../'),
|
||||||
entry: {
|
entry: {
|
||||||
webssh2: './client/src/js/index.js'
|
webssh2: './client/src/js/index.js',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new CleanWebpackPlugin(),
|
new CleanWebpackPlugin(),
|
||||||
new CopyWebpackPlugin({
|
new CopyWebpackPlugin({
|
||||||
patterns: [
|
patterns: ['./client/src/client.htm', './client/src/favicon.ico'],
|
||||||
'./client/src/client.htm',
|
|
||||||
'./client/src/favicon.ico'
|
|
||||||
]
|
|
||||||
}),
|
}),
|
||||||
new MiniCssExtractPlugin()
|
new MiniCssExtractPlugin(),
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].bundle.js',
|
filename: '[name].bundle.js',
|
||||||
path: path.resolve(__dirname, '../client/public')
|
path: path.resolve(__dirname, '../client/public'),
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
use: [MiniCssExtractPlugin.loader, 'css-loader'],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
const merge = require('webpack-merge')
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
const common = require('./webpack.common.js')
|
const merge = require('webpack-merge');
|
||||||
|
const common = require('./webpack.common.js');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
devServer: {
|
devServer: {
|
||||||
contentBase: '../client/public'
|
contentBase: '../client/public',
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
const TerserPlugin = require('terser-webpack-plugin')
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
const { merge } = require('webpack-merge')
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
const common = require('./webpack.common.js')
|
const { merge } = require('webpack-merge');
|
||||||
|
const common = require('./webpack.common.js');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
minimizer: [new TerserPlugin({
|
minimizer: [
|
||||||
terserOptions: {
|
new TerserPlugin({
|
||||||
ie8: false,
|
terserOptions: {
|
||||||
safari10: false
|
ie8: false,
|
||||||
}
|
safari10: false,
|
||||||
})]
|
},
|
||||||
}
|
}),
|
||||||
})
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue