Format js config file

This commit is contained in:
Franck Royer 2022-01-07 15:18:37 +11:00
parent e18c4f1619
commit add78bce71
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 27 additions and 27 deletions

View File

@ -6,27 +6,27 @@ module.exports = {
if (!config.resolve) config.resolve = {};
if (!config.resolve.fallback) config.resolve.fallback = {};
Object.assign(config.resolve.fallback, {
"buffer": require.resolve("buffer"),
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
// "assert": require.resolve("assert")
}
)
buffer: require.resolve('buffer'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
// "assert": require.resolve("assert")
});
if (!config.plugins) config.plugins = []
if (!config.plugins) config.plugins = [];
config.plugins.push(
new webpack.DefinePlugin({
'process.env.ENV': JSON.stringify("dev"),
'process.env.ENV': JSON.stringify('dev'),
})
)
);
config.plugins.push(
new webpack.ProvidePlugin({
process: 'process/browser.js',
Buffer: ['buffer', 'Buffer'],
}));
})
);
if (!config.ignoreWarnings) config.ignoreWarnings = []
config.ignoreWarnings.push(/Failed to parse source map/)
if (!config.ignoreWarnings) config.ignoreWarnings = [];
config.ignoreWarnings.push(/Failed to parse source map/);
return config;
},
@ -35,28 +35,28 @@ module.exports = {
if (!config.resolve) config.resolve = {};
if (!config.resolve.fallback) config.resolve.fallback = {};
Object.assign(config.resolve.fallback, {
"buffer": require.resolve("buffer"),
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
// "assert": require.resolve("assert")
}
)
buffer: require.resolve('buffer'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
// "assert": require.resolve("assert")
});
if (!config.plugins) config.plugins = []
if (!config.plugins) config.plugins = [];
config.plugins.push(
new webpack.DefinePlugin({
'process.env.ENV': JSON.stringify("prod"),
'process.env.ENV': JSON.stringify('prod'),
})
)
);
config.plugins.push(
new webpack.ProvidePlugin({
process: 'process/browser.js',
Buffer: ['buffer', 'Buffer'],
}));
})
);
if (!config.ignoreWarnings) config.ignoreWarnings = []
config.ignoreWarnings.push(/Failed to parse source map/)
if (!config.ignoreWarnings) config.ignoreWarnings = [];
config.ignoreWarnings.push(/Failed to parse source map/);
return config;
}
},
};

View File

@ -37,9 +37,9 @@
"fix": "run-s fix:*",
"test": "run-s build test:*",
"test:lint": "eslint src --ext .ts --ext .tsx",
"test:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" --list-different",
"test:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" \"./config/*.js\" --list-different",
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.{ts,tsx},public/**/*.html}\" -c ../../.cspell.json",
"fix:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" --write",
"fix:prettier": "prettier \"src/**/*.{ts,tsx}\" \"./*.json\" \"./config/*.js\" --write",
"fix:lint": "eslint src --ext .ts --ext .tsx --fix",
"proto": "run-s proto:*",
"proto:build": "buf generate",