chore: lint

This commit is contained in:
coderaiser 2023-07-09 12:43:24 +03:00
parent f1279666b5
commit 4717e035ee
173 changed files with 1388 additions and 1627 deletions

View file

@ -37,11 +37,8 @@ const plugins = clean([
const rules = [{
test: /\.css$/,
exclude: /css\/(nojs|view|config|terminal|user-menu|columns.*)\.css/,
use: extractMain.extract([
'css-loader',
]),
},
...cssPlugins.map(extract), {
use: extractMain.extract(['css-loader']),
}, ...cssPlugins.map(extract), {
test: /\.(png|gif|svg|woff|woff2|eot|ttf)$/,
use: {
loader: 'url-loader',
@ -63,7 +60,8 @@ function getCSSList(dir) {
const addDir = (name) => `${dir}/${name}`;
const rootDir = join(__dirname, '..');
return fs.readdirSync(`${rootDir}/css/${dir}`)
return fs
.readdirSync(`${rootDir}/css/${dir}`)
.map(base)
.map(addDir);
}
@ -73,9 +71,6 @@ function extract(extractPlugin) {
return {
test: RegExp(`css/${filename}`),
use: extractPlugin.extract([
'css-loader',
]),
use: extractPlugin.extract(['css-loader']),
};
}

View file

@ -19,25 +19,24 @@ module.exports = {
function getMinifyHtmlOptions() {
return {
removeComments: true,
removeCommentsFromCDATA: true,
removeCDATASectionsFromCDATA: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeComments: true,
removeCommentsFromCDATA: true,
removeCDATASectionsFromCDATA: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
/* оставляем, поскольку у нас
* в элемент fm генерируеться
* таблица файлов
*/
removeEmptyElements: false,
removeOptionalTags: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
removeEmptyElements: false,
removeOptionalTags: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
minifyJS: true,
minifyJS: true,
};
}

View file

@ -44,18 +44,17 @@ const rules = clean([
exclude: /node_modules/,
loader: 'babel-loader',
options,
}]);
},
]);
const plugins = [
new EnvironmentPlugin({
NODE_ENV,
}),
new ServiceWorkerWebpackPlugin({
entry: join(__dirname, '..', 'client', 'sw', 'sw.js'),
excludes: ['*'],
}),
new WebpackBar(),
];
@ -102,9 +101,7 @@ module.exports = {
devtoolModuleFilenameTemplate,
publicPath: '/dist/',
},
externals: [
externals,
],
externals: [externals],
module: {
rules,
noParse,
@ -132,4 +129,3 @@ function devtoolModuleFilenameTemplate(info) {
const resource = info.absoluteResourcePath.replace(rootDir + sep, '');
return `file://cloudcmd/${resource}`;
}