mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Add prettier and re-configure lint according to current best practises
This commit is contained in:
@@ -2,60 +2,63 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const vendor = Object.keys(require('./package.json').dependencies);
|
||||
const isProduction = process.argv.some((arg) => arg === '-p');
|
||||
const isProduction = process.argv.some(arg => arg === '-p');
|
||||
const supportedLocales = require('./src/i18n/index.json');
|
||||
const isTest = process.argv.some((arg) => arg.indexOf('karma') !== -1);
|
||||
const isTest = process.argv.some(arg => arg.indexOf('karma') !== -1);
|
||||
|
||||
process.env.NODE_ENV = 'development';
|
||||
|
||||
if (isTest) {
|
||||
process.env.NODE_ENV = 'test';
|
||||
process.env.NODE_ENV = 'test';
|
||||
}
|
||||
|
||||
if (isProduction) {
|
||||
throw new Error('Dll plugin should be used for dev mode only');
|
||||
throw new Error('Dll plugin should be used for dev mode only');
|
||||
}
|
||||
|
||||
const outputPath = path.join(__dirname, 'dll');
|
||||
|
||||
const webpackConfig = {
|
||||
mode: 'development',
|
||||
mode: 'development',
|
||||
|
||||
entry: {
|
||||
vendor: vendor.concat([
|
||||
'core-js/library',
|
||||
'redux-devtools',
|
||||
'redux-devtools-dock-monitor',
|
||||
'redux-devtools-log-monitor',
|
||||
'react-transform-hmr',
|
||||
'react-transform-catch-errors',
|
||||
]).concat(
|
||||
Object.keys(supportedLocales)
|
||||
.map((locale) => `react-intl/locale-data/${locale}.js`)
|
||||
)
|
||||
},
|
||||
entry: {
|
||||
vendor: vendor
|
||||
.concat([
|
||||
'core-js/library',
|
||||
'redux-devtools',
|
||||
'redux-devtools-dock-monitor',
|
||||
'redux-devtools-log-monitor',
|
||||
'react-transform-hmr',
|
||||
'react-transform-catch-errors',
|
||||
])
|
||||
.concat(
|
||||
Object.keys(supportedLocales).map(
|
||||
locale => `react-intl/locale-data/${locale}.js`,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
output: {
|
||||
filename: '[name].dll.js?[hash]',
|
||||
path: outputPath,
|
||||
library: '[name]',
|
||||
publicPath: '/'
|
||||
},
|
||||
output: {
|
||||
filename: '[name].dll.js?[hash]',
|
||||
path: outputPath,
|
||||
library: '[name]',
|
||||
publicPath: '/',
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
|
||||
},
|
||||
__DEV__: true,
|
||||
__TEST__: isTest,
|
||||
__PROD__: false
|
||||
}),
|
||||
new webpack.DllPlugin({
|
||||
name: '[name]',
|
||||
path: path.join(outputPath, '[name].json')
|
||||
})
|
||||
]
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
|
||||
},
|
||||
__DEV__: true,
|
||||
__TEST__: isTest,
|
||||
__PROD__: false,
|
||||
}),
|
||||
new webpack.DllPlugin({
|
||||
name: '[name]',
|
||||
path: path.join(outputPath, '[name].json'),
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = webpackConfig;
|
||||
|
Reference in New Issue
Block a user