Allow disabling eslint checks for development purposes
Sometimes developers want to quickly check if something work and there is no need to style to eslint liking.
This commit is contained in:
parent
ea8b606243
commit
052eb5d57a
1 changed files with 7 additions and 4 deletions
|
|
@ -13,6 +13,9 @@ const CockpitRsyncPlugin = require("./src/lib/cockpit-rsync-plugin");
|
|||
/* A standard nodejs and webpack pattern */
|
||||
const production = process.env.NODE_ENV === 'production';
|
||||
|
||||
/* development options for faster iteration */
|
||||
const eslint = process.env.ESLINT !== '0';
|
||||
|
||||
// Obtain package name from package.json
|
||||
const packageJson = JSON.parse(fs.readFileSync('package.json'));
|
||||
|
||||
|
|
@ -25,14 +28,14 @@ const copy_files = [
|
|||
const plugins = [
|
||||
new copy({ patterns: copy_files }),
|
||||
new extract({filename: "[name].css"}),
|
||||
new ESLintPlugin({
|
||||
extensions: ["js", "jsx"],
|
||||
failOnWarning: true,
|
||||
}),
|
||||
new CockpitPoPlugin(),
|
||||
new CockpitRsyncPlugin({dest: packageJson.name}),
|
||||
];
|
||||
|
||||
if (eslint) {
|
||||
plugins.push(new ESLintPlugin({ extensions: ["js", "jsx"], failOnWarning: true, }));
|
||||
}
|
||||
|
||||
/* Only minimize when in production mode */
|
||||
if (production) {
|
||||
plugins.unshift(new CompressionPlugin({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue