Skip to content

Commit d55dc37

Browse files
committed
[ESLint] Disable on prod instances
1 parent 8a6086d commit d55dc37

File tree

1 file changed

+48
-45
lines changed

1 file changed

+48
-45
lines changed

webpack.config.js

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,53 @@ function lorisModule(mname, entries, override=false) {
157157
};
158158
}
159159

160+
const plugins = [
161+
new CopyPlugin({
162+
patterns: [
163+
{
164+
from: path.resolve(__dirname, 'node_modules/react/umd'),
165+
to: path.resolve(__dirname, 'htdocs/vendor/js/react'),
166+
force: true,
167+
globOptions: {
168+
ignore: ['react.profiling.min.js'],
169+
},
170+
filter: async (path) => {
171+
const file = path.split('\\').pop().split('/').pop();
172+
const keep = [
173+
'react.development.js',
174+
'react.production.min.js',
175+
];
176+
return keep.includes(file);
177+
},
178+
},
179+
{
180+
from: path.resolve(__dirname, 'node_modules/react-dom/umd'),
181+
to: path.resolve(__dirname, 'htdocs/vendor/js/react'),
182+
force: true,
183+
filter: async (path) => {
184+
const file = path.split('\\').pop().split('/').pop();
185+
const keep = [
186+
'react-dom.development.js',
187+
'react-dom.production.min.js',
188+
];
189+
return keep.includes(file);
190+
},
191+
},
192+
],
193+
}),
194+
];
195+
196+
mode == 'development' && plugins.push(new ESLintPlugin({
197+
files: [
198+
'modules/',
199+
'jsx/',
200+
'jslib/',
201+
'htdocs/js/',
202+
'webpack.config.js',
203+
],
204+
cache: true,
205+
}));
206+
160207
let config = [
161208
// Core components
162209
{
@@ -182,51 +229,7 @@ let config = [
182229
'react-dom': 'ReactDOM',
183230
},
184231
devtool: 'source-map',
185-
plugins: [
186-
new ESLintPlugin({
187-
files: [
188-
'modules/',
189-
'jsx/',
190-
'jslib/',
191-
'htdocs/js/',
192-
'webpack.config.js',
193-
],
194-
cache: true,
195-
}),
196-
new CopyPlugin({
197-
patterns: [
198-
{
199-
from: path.resolve(__dirname, 'node_modules/react/umd'),
200-
to: path.resolve(__dirname, 'htdocs/vendor/js/react'),
201-
force: true,
202-
globOptions: {
203-
ignore: ['react.profiling.min.js'],
204-
},
205-
filter: async (path) => {
206-
const file = path.split('\\').pop().split('/').pop();
207-
const keep = [
208-
'react.development.js',
209-
'react.production.min.js',
210-
];
211-
return keep.includes(file);
212-
},
213-
},
214-
{
215-
from: path.resolve(__dirname, 'node_modules/react-dom/umd'),
216-
to: path.resolve(__dirname, 'htdocs/vendor/js/react'),
217-
force: true,
218-
filter: async (path) => {
219-
const file = path.split('\\').pop().split('/').pop();
220-
const keep = [
221-
'react-dom.development.js',
222-
'react-dom.production.min.js',
223-
];
224-
return keep.includes(file);
225-
},
226-
},
227-
],
228-
}),
229-
],
232+
plugins: plugins,
230233
optimization: optimization,
231234
resolve: resolve,
232235
module: mod,

0 commit comments

Comments
 (0)