Merge branch 'master' of github.com:chatwoot/chatwoot

This commit is contained in:
subintp 2019-08-21 21:53:48 +05:30
commit e21bb22972
4 changed files with 42 additions and 41 deletions

View file

@ -1,18 +1,20 @@
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
var isTestEnv = api.env('test')
/* eslint-disable global-require */
module.exports = api => {
const validEnv = ['development', 'test', 'production'];
const currentEnv = api.env();
const isDevelopmentEnv = api.env('development');
const isProductionEnv = api.env('production');
const isTestEnv = api.env('test');
if (!validEnv.includes(currentEnv)) {
throw new Error(
'Please specify a valid `NODE_ENV` or ' +
`${'Please specify a valid `NODE_ENV` or ' +
'`BABEL_ENV` environment variables. Valid values are "development", ' +
'"test", and "production". Instead, received: ' +
JSON.stringify(currentEnv) +
'.'
)
'"test", and "production". Instead, received: '}${JSON.stringify(
currentEnv
)}.`
);
}
return {
@ -21,9 +23,9 @@ module.exports = function(api) {
require('@babel/preset-env').default,
{
targets: {
node: 'current'
}
}
node: 'current',
},
},
],
(isProductionEnv || isDevelopmentEnv) && [
require('@babel/preset-env').default,
@ -32,9 +34,9 @@ module.exports = function(api) {
useBuiltIns: 'entry',
corejs: 3,
modules: false,
exclude: ['transform-typeof-symbol']
}
]
exclude: ['transform-typeof-symbol'],
},
],
].filter(Boolean),
plugins: [
require('babel-plugin-macros'),
@ -44,32 +46,30 @@ module.exports = function(api) {
[
require('@babel/plugin-proposal-class-properties').default,
{
loose: true
}
loose: true,
},
],
[
require('@babel/plugin-proposal-object-rest-spread').default,
{
useBuiltIns: true
}
useBuiltIns: true,
},
],
[
require('@babel/plugin-transform-runtime').default,
{
helpers: false,
regenerator: true,
corejs: false
}
corejs: false,
},
],
[
require('@babel/plugin-transform-regenerator').default,
{
async: false
}
async: false,
},
],
[
require('babel-plugin-transform-vue-jsx')
]
].filter(Boolean)
}
}
[require('babel-plugin-transform-vue-jsx')],
].filter(Boolean),
};
};

View file

@ -1,8 +1,9 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
const dotenv = require('dotenv')
dotenv.config({ path: '.env', silent: true })
const dotenv = require('dotenv');
const environment = require('./environment')
dotenv.config({ path: '.env', silent: true });
module.exports = environment.toWebpackConfig()
const environment = require('./environment');
module.exports = environment.toWebpackConfig();

View file

@ -7,7 +7,7 @@ default: &default
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: false
webpack_compile_output: true
# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']

View file

@ -5,6 +5,10 @@
"@rails/webpacker": "^4.0.7",
"axios": "^0.19.0",
"bourbon": "~4.2.7",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"babel-preset-env": "^1.7.0",
"chart.js": "~2.5.0",
"dotenv": "^8.0.0",
"emojione": "~2.2.7",
@ -37,10 +41,6 @@
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"babel-preset-env": "^1.7.0",
"eslint": "^5.13.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.0.0",