mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore: cloudcmd: actions: lint ☘️
This commit is contained in:
parent
656d8fd60c
commit
256fbcdfaa
2 changed files with 26 additions and 27 deletions
|
|
@ -1,39 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
const {env} = require('node:process')
|
||||
const {env} = require('node:process');
|
||||
|
||||
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
|
||||
const isDev = env.NODE_ENV === 'development';
|
||||
|
||||
const clean = (a) => a.filter(Boolean);
|
||||
|
||||
const plugins = clean([
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
}),
|
||||
!isDev && new OptimizeCssAssetsPlugin(),
|
||||
]);
|
||||
|
||||
const rules = [{
|
||||
test: /\.css$/i,
|
||||
use: [MiniCssExtractPlugin.loader, {
|
||||
loader: "css-loader",
|
||||
options: {
|
||||
url: true,
|
||||
},
|
||||
}],
|
||||
}, {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
url: true,
|
||||
},
|
||||
}],
|
||||
}, {
|
||||
test: /\.(png|gif|svg|woff|woff2|eot|ttf)$/,
|
||||
type: 'asset/inline',
|
||||
}]
|
||||
|
||||
}];
|
||||
|
||||
module.exports = {
|
||||
plugins,
|
||||
module: {
|
||||
rules,
|
||||
},
|
||||
module: {
|
||||
rules,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@ const {
|
|||
} = require('node:path');
|
||||
|
||||
const {env} = require('node:process');
|
||||
const {EnvironmentPlugin, NormalModuleReplacementPlugin} = require('webpack');
|
||||
const {
|
||||
EnvironmentPlugin,
|
||||
NormalModuleReplacementPlugin,
|
||||
} = require('webpack');
|
||||
const WebpackBar = require('webpackbar');
|
||||
|
||||
//const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
|
||||
|
||||
const modules = './modules';
|
||||
const dirModules = './client/modules';
|
||||
const dir = './client';
|
||||
|
|
@ -47,18 +49,17 @@ const rules = clean([
|
|||
|
||||
const plugins = [
|
||||
new NormalModuleReplacementPlugin(/^node:/, (resource) => {
|
||||
resource.request = resource.request.replace(/^node:/, '');
|
||||
}),
|
||||
resource.request = resource.request.replace(/^node:/, '');
|
||||
}),
|
||||
new EnvironmentPlugin({
|
||||
NODE_ENV,
|
||||
}),
|
||||
/*
|
||||
/*
|
||||
new ServiceWorkerWebpackPlugin({
|
||||
entry: join(__dirname, '..', 'client', 'sw', 'sw.js'),
|
||||
excludes: ['*'],
|
||||
}),
|
||||
*/
|
||||
new WebpackBar(),
|
||||
*/new WebpackBar(),
|
||||
];
|
||||
|
||||
const splitChunks = {
|
||||
|
|
@ -74,9 +75,9 @@ module.exports = {
|
|||
'node:path': 'path',
|
||||
},
|
||||
fallback: {
|
||||
"path": require.resolve("path-browserify"),
|
||||
"process": require.resolve("process/browser")
|
||||
}
|
||||
'path': require.resolve('path-browserify'),
|
||||
'process': require.resolve('process/browser'),
|
||||
},
|
||||
},
|
||||
devtool,
|
||||
optimization: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue