-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config-test.babel.js
49 lines (43 loc) · 1.41 KB
/
webpack.config-test.babel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import path from 'path';
import nodeExternals from 'webpack-node-externals';
module.exports = {
output: {
// use absolute paths in sourcemaps (important for debugging via IDE)
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]'
},
target: 'node', // webpack should compile node compatible code
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
devtool: "inline-cheap-module-source-map",
resolve: {
extensions: ['.js', '.jsx', '.json'],
modules: ['node_modules'],
alias: {
Actions: path.resolve(__dirname, 'src/actions/'),
Aliases: path.resolve(__dirname, 'src/aliases/'),
Components: path.resolve(__dirname, 'src/components/'),
Img: path.resolve(__dirname, 'src/img/'),
Reducers: path.resolve(__dirname, 'src/reducers/'),
Styles: path.resolve(__dirname, 'src/styles/'),
Lib: path.resolve(__dirname, 'lib/'),
Tests: path.resolve(__dirname, 'tests/'),
Utils: path.resolve(__dirname, 'src/utils/'),
Constants: path.resolve(__dirname, 'src/constants/')
},
},
module: {
rules: [
{
test: /\.(jsx|js)?$/,
use: [
{
loader: 'babel-loader',
options: {
presets: ['es2015', 'react'],
}
}
],
},
],
},
};