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) { /* eslint-disable global-require */
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env() module.exports = api => {
var isDevelopmentEnv = api.env('development') const validEnv = ['development', 'test', 'production'];
var isProductionEnv = api.env('production') const currentEnv = api.env();
var isTestEnv = api.env('test') const isDevelopmentEnv = api.env('development');
const isProductionEnv = api.env('production');
const isTestEnv = api.env('test');
if (!validEnv.includes(currentEnv)) { if (!validEnv.includes(currentEnv)) {
throw new Error( 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", ' + '`BABEL_ENV` environment variables. Valid values are "development", ' +
'"test", and "production". Instead, received: ' + '"test", and "production". Instead, received: '}${JSON.stringify(
JSON.stringify(currentEnv) + currentEnv
'.' )}.`
) );
} }
return { return {
@ -21,9 +23,9 @@ module.exports = function(api) {
require('@babel/preset-env').default, require('@babel/preset-env').default,
{ {
targets: { targets: {
node: 'current' node: 'current',
} },
} },
], ],
(isProductionEnv || isDevelopmentEnv) && [ (isProductionEnv || isDevelopmentEnv) && [
require('@babel/preset-env').default, require('@babel/preset-env').default,
@ -32,9 +34,9 @@ module.exports = function(api) {
useBuiltIns: 'entry', useBuiltIns: 'entry',
corejs: 3, corejs: 3,
modules: false, modules: false,
exclude: ['transform-typeof-symbol'] exclude: ['transform-typeof-symbol'],
} },
] ],
].filter(Boolean), ].filter(Boolean),
plugins: [ plugins: [
require('babel-plugin-macros'), require('babel-plugin-macros'),
@ -44,32 +46,30 @@ module.exports = function(api) {
[ [
require('@babel/plugin-proposal-class-properties').default, require('@babel/plugin-proposal-class-properties').default,
{ {
loose: true loose: true,
} },
], ],
[ [
require('@babel/plugin-proposal-object-rest-spread').default, require('@babel/plugin-proposal-object-rest-spread').default,
{ {
useBuiltIns: true useBuiltIns: true,
} },
], ],
[ [
require('@babel/plugin-transform-runtime').default, require('@babel/plugin-transform-runtime').default,
{ {
helpers: false, helpers: false,
regenerator: true, regenerator: true,
corejs: false corejs: false,
} },
], ],
[ [
require('@babel/plugin-transform-regenerator').default, require('@babel/plugin-transform-regenerator').default,
{ {
async: false async: false,
} },
], ],
[ [require('babel-plugin-transform-vue-jsx')],
require('babel-plugin-transform-vue-jsx') ].filter(Boolean),
] };
].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') const dotenv = require('dotenv');
dotenv.config({ path: '.env', silent: true })
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 public_output_path: packs
cache_path: tmp/cache/webpacker cache_path: tmp/cache/webpacker
check_yarn_integrity: false check_yarn_integrity: false
webpack_compile_output: false webpack_compile_output: true
# Additional paths webpack should lookup modules # Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets'] # ['app/assets', 'engine/foo/app/assets']

View file

@ -5,6 +5,10 @@
"@rails/webpacker": "^4.0.7", "@rails/webpacker": "^4.0.7",
"axios": "^0.19.0", "axios": "^0.19.0",
"bourbon": "~4.2.7", "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", "chart.js": "~2.5.0",
"dotenv": "^8.0.0", "dotenv": "^8.0.0",
"emojione": "~2.2.7", "emojione": "~2.2.7",
@ -37,10 +41,6 @@
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^10.0.1", "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": "^5.13.0",
"eslint-config-airbnb": "^17.1.0", "eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.0.0", "eslint-config-prettier": "^4.0.0",