base-webpack.config.js 536 B

12345678910111213141516171819202122232425262728293031
  1. const path = require('path');
  2. const packageName = require('../package.json').name;
  3. const { getWebpackVersion } = require('../lib/utils');
  4. const webpackVersion = getWebpackVersion();
  5. const config = {
  6. output: {
  7. filename: '[name].js'
  8. },
  9. devtool: false,
  10. resolve: {
  11. alias: {
  12. [packageName]: path.resolve(__dirname, '..')
  13. }
  14. },
  15. resolveLoader: {
  16. alias: {
  17. [packageName]: path.resolve(__dirname, '..')
  18. }
  19. }
  20. };
  21. if (webpackVersion >= 4) {
  22. config.mode = 'development';
  23. }
  24. module.exports = config;