Skip to content

Commit

Permalink
[ESLint] Disable on prod instances
Browse files Browse the repository at this point in the history
  • Loading branch information
laemtl committed Dec 20, 2022
1 parent 8a6086d commit d55dc37
Showing 1 changed file with 48 additions and 45 deletions.
93 changes: 48 additions & 45 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,53 @@ function lorisModule(mname, entries, override=false) {
};
}

const plugins = [
new CopyPlugin({
patterns: [
{
from: path.resolve(__dirname, 'node_modules/react/umd'),
to: path.resolve(__dirname, 'htdocs/vendor/js/react'),
force: true,
globOptions: {
ignore: ['react.profiling.min.js'],
},
filter: async (path) => {
const file = path.split('\\').pop().split('/').pop();
const keep = [
'react.development.js',
'react.production.min.js',
];
return keep.includes(file);
},
},
{
from: path.resolve(__dirname, 'node_modules/react-dom/umd'),
to: path.resolve(__dirname, 'htdocs/vendor/js/react'),
force: true,
filter: async (path) => {
const file = path.split('\\').pop().split('/').pop();
const keep = [
'react-dom.development.js',
'react-dom.production.min.js',
];
return keep.includes(file);
},
},
],
}),
];

mode == 'development' && plugins.push(new ESLintPlugin({
files: [
'modules/',
'jsx/',
'jslib/',
'htdocs/js/',
'webpack.config.js',
],
cache: true,
}));

let config = [
// Core components
{
Expand All @@ -182,51 +229,7 @@ let config = [
'react-dom': 'ReactDOM',
},
devtool: 'source-map',
plugins: [
new ESLintPlugin({
files: [
'modules/',
'jsx/',
'jslib/',
'htdocs/js/',
'webpack.config.js',
],
cache: true,
}),
new CopyPlugin({
patterns: [
{
from: path.resolve(__dirname, 'node_modules/react/umd'),
to: path.resolve(__dirname, 'htdocs/vendor/js/react'),
force: true,
globOptions: {
ignore: ['react.profiling.min.js'],
},
filter: async (path) => {
const file = path.split('\\').pop().split('/').pop();
const keep = [
'react.development.js',
'react.production.min.js',
];
return keep.includes(file);
},
},
{
from: path.resolve(__dirname, 'node_modules/react-dom/umd'),
to: path.resolve(__dirname, 'htdocs/vendor/js/react'),
force: true,
filter: async (path) => {
const file = path.split('\\').pop().split('/').pop();
const keep = [
'react-dom.development.js',
'react-dom.production.min.js',
];
return keep.includes(file);
},
},
],
}),
],
plugins: plugins,
optimization: optimization,
resolve: resolve,
module: mod,
Expand Down

0 comments on commit d55dc37

Please # to comment.