MyCrypto/webpack_config/utils.js

29 lines
557 B
JavaScript
Raw Normal View History

2017-07-04 03:28:56 +00:00
'use strict';
const path = require('path');
const config = require('./config');
2017-07-04 03:28:56 +00:00
const _ = (module.exports = {});
2017-07-04 03:28:56 +00:00
_.cwd = file => {
return path.join(process.cwd(), file || '');
};
2017-07-04 03:28:56 +00:00
_.outputPath = path.join(__dirname, '../dist');
2017-07-04 03:28:56 +00:00
_.outputIndexPath = path.join(__dirname, '../dist/index.html');
2017-07-04 03:28:56 +00:00
_.target = 'web';
_.loadersOptions = () => {
2017-07-04 03:28:56 +00:00
const isProd = process.env.NODE_ENV === 'production';
2017-07-04 03:28:56 +00:00
return {
minimize: isProd,
options: {
// css-loader relies on context
context: process.cwd(),
babel: config.babel
}
2017-07-04 03:28:56 +00:00
};
};