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